You are viewing a single comment's thread. Return to all comments →
Hi Rishu,
I tried your code and I made it work after it initially failed 5 (6,7,12,13,14) cases. Small change -
case 1: scanf(" %lli",&x); if(max[topm]<x) { max[++topm]=x; }
to
case 1: scanf(" %lli",&x); if(max[topm]<=x) { max[++topm]=x; }
Seems like cookies are disabled on this browser, please enable them to open this website
Maximum Element
You are viewing a single comment's thread. Return to all comments →
Hi Rishu,
I tried your code and I made it work after it initially failed 5 (6,7,12,13,14) cases. Small change -
to