Can I get the code of above program

I wrote above code by myself but I am not sure about my program so may I get the code of above problem also with test cases.
Is it available on Hackerblocks?

hi @priya_Jain https://hack.codingblocks.com/app/contests/1463/1066/problem