Only 1 test case failed Why?
Solution Link-https://ide.codingblocks.com/s/65910
hi
your code in not showing correct answer for initial input test cases, Please check it once again, also having compilation errors
Hi,
Can not understand your “isCounted” array. what are you trying to precompute?
check my code :https://ide.codingblocks.com/s/67176
you can also check sanjeets’s code: https://ide.codingblocks.com/s/67176 (better commented)
@sanjeetboora Thanks for your code! 
Hit like if you get it.