You are viewing a single comment's thread. Return to all comments →
C++ O(n) solution thanks to std::next_permutation:
string biggerIsGreater(string w) { if (next_permutation(w.begin(), w.end())) return w; return "no answer"; }
Seems like cookies are disabled on this browser, please enable them to open this website
Bigger is Greater
You are viewing a single comment's thread. Return to all comments →
C++ O(n) solution thanks to std::next_permutation: