Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // link https://leetcode.com/discuss/interview-question/1371222/Google-Questions
- void f(vector<int> &v){
- map<int,int> m;
- for(auto &c: v){
- auto t=m.upper_bound(c);
- if(t!=m.end()) m.erase(t->first);
- m[c]=1;
- }
- cout<<m.size()<<" ";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement