All rows are having identical length. We could thus use
either representative matrix[0].length or matrix[1].length as well. However
choosing matrix[row].length also
works in case of different row lengths.