One Test Case giving WA

at line 13 , instead of if(arr[ j ]!=1) it should be if(arr[ i ]!=1)
corrected code :- https://ide.codingblocks.com/s/246589

In case of any doubt feel free to ask :slight_smile:
mark your doubt as resolved if you got the answer