Can someone provide the test cases for the Last problem
What did you take x as ? Row or column number?
After interchanging the x and y, my code is running perfectly now
This is the exact doubt that I had! Turns out that x represents row number (vertical) and y represents column number (horizontal) according to this question.
Pasting my question here again:
I tried this problem literally for the whole two and half hours of the contest time.
I thought the matrix in the question follows the Cartesian coordinate system, like x represents horizontal index and y represents vertical.
But to my surprise, after the contest has ended, I got to know from other solutions that my assumption was wrong and the x in the question meant to represent the vertical index and y for horizontal.
So, I just want to know if there is any convention that I am missing that would clear this out for me in future? or is the question flawed?
I too though that x and y represent x axis and y axis. Even the problem didn’t explicitly focus on the fact that these are row and column number respectively. In the description, it said moves can either be right or down and in next line : (x+1,y) or (x,y+1).
So i didn’t even think once before assuming it. Even after the contest ended, I was waiting for someone to point it out. But I think, only few like us misinterpreted it.
In my case there were two issues. Initially I took x as column number and y as row number(which I corrected after reading the problem statement thoroughly). Then there was integer overflow while calculating the path value.
it was mentioned in the question.
Let (x,y) denote the cell in the x-th row and y-th column.
Ohhhhhh! Thanks for the answer. Didn’t notice that. Guess I was just so dumb and pissed off yesterday😂