Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Tic-Tac IN JAVA Problem: Given a 3x3 grid representing a finished tic-tac-toe game, return a string declaring who won. You can use a helper method
Tic-Tac IN JAVA
Problem: Given a 3x3 grid representing a finished tic-tac-toe game, return a string declaring who won.
You can use a helper method to assist in solving this problem.
Data: The matrix will not be empty nor null. Matrices will all be 3 X 3.
Output: If x's won, return "x won!". If o's won, return "o won!". If it is a tie, return "tie!"
Sample Data
[['x','o','o'],['x','o','x'],['o','x','x']]
[['x','x','o'],['x','o','x'],['x','o','x']]
Sample Output
o won!
x won!
String go(char[][] mat)
{
// your code goes here
}
please use the given format
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started