|x| x == "x" || x == "o" } x_array = xo_array.partition { |x| x == "x" }.first o_array = xo_array.partition { |x| x == "x" }.last x_array.size == o_array.size end
and call it x_array x_array = xo_array.partition { |x| x == "x" }.first # make an array of all the o's and call it o_array o_array = xo_array.partition { |x| x == "x" }.last ...
and split it into an array 2. Make an array of all the x's and call it x_array 3. Make an array of all the o's and call it o_array 4. Compare the size of x_array to o_array. Return true if they're the same size, and false if they aren't.
of x_array to o_array. Return true if they're the same size, and false if they aren't. def same_num_of_xs_os?(x_array, o_array) x_array.size == o_array.size end
we even need to make arrays for x’s and o’s?? Why can’t we just count the number of x’s in the string and compare that count to the number of o’s in the string??