Skip to content

Instantly share code, notes, and snippets.

@ABHIINAV12
Created November 9, 2020 02:45
Show Gist options
  • Save ABHIINAV12/b017be13713b155c2b6470f9b5f3e682 to your computer and use it in GitHub Desktop.
Save ABHIINAV12/b017be13713b155c2b6470f9b5f3e682 to your computer and use it in GitHub Desktop.
getting the next permutation
class Solution {
public:
void nextPermutation(vector<int>& nums) {
bool xp=next_permutation(nums.begin(),nums.end());
if(!xp) sort(nums.begin(),nums.end());
return ;
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment