rows[i] is row i, its letters are flush with the left edge, and rows may differ in length. Column k reads from top to bottom and is made of the k-th letters of the rows, for as long as they have one.
The grid works if, for every k, row k and column k both exist and read the same. Return True if the grid works, and False otherwise.rows=["cat", "ape", "ten"] → True
Row 0 and column 0 both read cat, row 1 and column 1 read ape, row 2 and column 2 read ten.
rows=["sea", "ex", "a"] → True
The rows have different lengths, but the columns read sea, ex, a, which matches.
rows=["map", "ago", "pen"] → False
Row 2 reads pen, while column 2 reads pon.
rows[i] consists of lowercase English lettersrows=["cat", "ape", "ten"]
True
Run checks the first 3 tests in your browser. Submit checks all 111 tests on the server, hidden ones included.