O(N^2) in terms of what?


What is N here? Number of elements on the rectangle or side of the rectangle?


Must be side of rectangle.


Both are the same.

This random text is to skip the character limit


O(RxC) is what they mean. Basically, a quadratic solution.


That’s a linear solution on the size of the input, not quadratic.