Getting no answer

question -https://codeforces.com/contest/1385/problem/C

ans -https://ide.codingblocks.com/s/287965

i am getting error and i dont know how to correct, please tell me why this error is occurring and how to corret it

@shivamgoel150

  1. Change line 27 to while(j>0)
  2. In both while() loop, if if(a[j]<=a[j-1]) condition isn’t true. Your j will never decrement thus your code stuck in infinite loop. thus add else break; condition