Whats wrong in my code only one test case is passed and i guess its corect

hello @anantgovil123
no it is not.
just print the pattern and observe the differnce

image
third row should have only 3 1’s but u r print 4.
similary for other rows.