• + 5 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;
                             }