Simple O(R+C) time complexity


#1

Comment body goes here.