Pattern with zeros

The code is giving wrong answer when I submit but works fine when I give custom input.

Hi @Chetna_Agarwal,
Please send your code so that i can review it.