Refer to the code: -
Time Limit Exceeded
@ambuj_0909 You need to decrement n, while taking input.
while(n>0)
{
int data;
cin>>data;
s.push(data);
nā;
}
Refer to the code: -
@ambuj_0909 You need to decrement n, while taking input.
while(n>0)
{
int data;
cin>>data;
s.push(data);
nā;
}