Cleared all but 1 test case left. Please tell correction

cleared all but 1 test case left. Please tell correction ; https://ide.codingblocks.com/s/666967

hi @akshat1409 updated https://ide.codingblocks.com/s/667011

why is it important to write bool true and bool false. why cant we use if statement directly. if a[j]=m; cout<< else cout<<-1 ??

Yes it’s imp for printing -1 you need to check if you have got your ans before or not if not then only u can print -1

i dont understand what u mean by "you need to check if you have got your ans before or not’’ whats wrong with directly writing if(a[j]==m){ ind=j; Also what is the meaning of writing ans in bracket? how just writing (and) after if an argument? if(ans)cout<<ind<<endl;

@akshat1409 the mean of if(ans) is if(ans == true) and now ur task is do do a dryrun for an element which is not present on paper, hope this helps :slight_smile: