Hello, here is my code and it’s not working.
Could you please help me in debugging my code ?
Doubt in my code
Hey @yashsharma4304 see the problem in your code is with the variable row
Your value of row is 0 And your col value is also 0 , now it goes in while statement and remains there until row <=2 , since your col value is 0 so 0%2 == 0 so it will decrement row , now your row is at -1 and there isn’t any index a[-1][0] , moreover in, i integer(Odd) you are increasing row and in i+1(even) your are decreasing row. So how would it be equal to 2?
Take reference from this code
1 Like
Ok Now I see the problem in my code. Thanks a lot for your help
1 Like