How do we count more?
Hopefully, you have understood this procedure well. Similarly, we can expand the ‘matrix’ to infinitely large, that is, we can count all the points which have positive integer coordinates in a 2-D space.
Given a coordinate, you need to return its index and given an index, you need to return its coordinate.