We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
int main()
{
long long int top=-1,topm=0,arr[10000],max[10000],n,elem,i,qtype,x;
max[topm]=0;
scanf("%lld",&n);
for(i=0;i
}
case 2:
{
if(max[topm]==arr[top])
--topm;
--top;
break;
}
case 3:
printf("%lld\n",max[topm]);
break;
}
}
}
Hi Anirudh I tried this way but it is failing 14-28 case
please help.
Cookie support is required to access HackerRank
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 →
include
include
int main() { long long int top=-1,topm=0,arr[10000],max[10000],n,elem,i,qtype,x; max[topm]=0; scanf("%lld",&n); for(i=0;i } case 2: { if(max[topm]==arr[top]) --topm; --top; break; } case 3: printf("%lld\n",max[topm]); break; } } } Hi Anirudh I tried this way but it is failing 14-28 case please help.