We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 044942b commit 3b43ba2Copy full SHA for 3b43ba2
solution/3600-3699/3644.Maximum K to Sort a Permutation/README.md
@@ -95,6 +95,17 @@ edit_url: https://github.com/doocs/leetcode/edit/main/solution/3600-3699/3644.Ma
95
#### C++
96
97
```cpp
98
+class Solution {
99
+public:
100
+ int sortPermutation(vector<int>& nums) {
101
+ if(is_sorted(nums.begin(),nums.end())) return 0;
102
+ int ans=0x7fffffff;
103
+ for(int i=0;i<nums.size();i++){
104
+ if(nums[i]!=i) ans&=i;
105
+ }
106
+ return ans;
107
108
+};
109
110
```
111
0 commit comments