@eyeamgj Let's take a matrix of 4x4. Either you're gonna travel towards right or bottom if we're starting from the (1,1). So maximum path will be, if you traversed all the way to the bottom row i.e. (1,1) – (2,1) – (3,1) – (4,1) and then you traversed across all the way to the end element (4,4). At max this will take O(n+n). Therefore O(n)