diff options
Diffstat (limited to 'other/orderly_queue.cpp')
-rw-r--r-- | other/orderly_queue.cpp | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/other/orderly_queue.cpp b/other/orderly_queue.cpp deleted file mode 100644 index 23053d2..0000000 --- a/other/orderly_queue.cpp +++ /dev/null @@ -1,20 +0,0 @@ -#include "leetcode.h" - -class Solution { -public: - string orderlyQueue(string s, int k) { - if (k > 1) { - sort(s.begin(), s.end()); - return s; - } - string ans = s; - for (int i = 1; i < s.size(); i++) - ans = min(ans, s.substr(i) + s.substr(0, i)); - return ans; - } -}; - -int main() { - Solution obj; - cout << obj.orderlyQueue("cba", 1); -} |