tiles with m rows and n columns; each number is a tile's color. The floor is striped if every tile meets both conditions:
- the tile directly below it (if any) has the same color;
- the tile directly to its right (if any) has a different color.
Return True if the floor is striped, and False otherwise.tiles=[[3, 7, 3], [3, 7, 3]] → True
Each column is a single color, and neighboring columns differ: 3 ≠ 7, 7 ≠ 3.
tiles=[[4, 4], [4, 4]] → False
The columns are uniform, but side-by-side tiles in a row match.
tiles=[[2, 5], [2, 6]] → False
The second column holds 5 and 6, so it is not a single color.
tiles=[[3, 7, 3], [3, 7, 3]]
True
Run checks the first 3 tests in your browser. Submit checks all 118 tests on the server, hidden ones included.