Skip to content

chetana-H/proj5

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

#include<stdio.h> using namespace std; #define ll long long int int main() { ll n; cin>>n; ll a[n+1]; for(ll i=1;i<=n;i++) cin>>a[i]; ll c=1; stack s; for(ll i=1;i<=n;i++) { s.push(a[i]); while((!s.empty()) && (c==s.top())) { c++; s.pop(); } } if(!s.empty()) cout<<"Sad"<<endl; else cout<<"Happy"<<endl; }

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published