Sponsored
Use these hints if you're stuck. Try solving on your own first.
Flipping same index two times is like not flipping it at all. Each index can be flipped one time. Try all possible combinations. O(2^(n*m)).
Solve with full IDE support and test cases