2nd test case didn’t pass giving run time error.
https://ide.codingblocks.com/s/145991
@prashantverma.vn just increase the size of the array from 1000 to 1000000.