I guess we not only need two variables for the row and column indexes of the current element, but also some more variables for the range (i.e., how many rows and columns) of
I solved it keeping track of 3 things:
- A reference to the original vector
- A row iterator
- A column iterator
Hi, cbrghostrider. I have similar cases as yours. I guess two variables is not enough.
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.