Time Limit Exceeded

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ā€“;
}