class LargestSubsequence { public: string getLargest(string s) { if (s.size() == 0) return ""; char mx = *max_element(s.begin(), s.end()); return string(1, mx) + getLargest(s.substr(s.find(mx) + 1)); } };