Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. #include <string>
  2. #include <algorithm>
  3. using namespace std;
  4.  
  5. class LargestSubsequence {
  6. public:
  7. string getLargest(string s) {
  8. string res;
  9. for (auto base = s.begin(); base != s.end(); ++base) {
  10. auto it = max_element(base, s.end());
  11. res += *it;
  12. base = it;
  13. }
  14. return res;
  15. }
  16. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement