Need help with a small doubt

hello @devanshkapur
your code looks correct.
what issue u r facing/

its printing 1 2 instead of 1 1 in second row

add an if statement , to handle this case