Skip to content

Commit 4f43010

Browse files
committed
Runtime: 55 ms (Top 25.45%) | Memory: 44.9 MB (Top 5.73%)
1 parent e779a35 commit 4f43010

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

scripts/algorithms/M/Minimum Number of Operations to Reinitialize a Permutation/Minimum Number of Operations to Reinitialize a Permutation.cpp

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Runtime: 55 ms (Top 25.45%) | Memory: 44.9 MB (Top 5.73%)
12
class Solution {
23
public:
34
vector<int> change(vector<int>arr,vector<int>v){
@@ -18,18 +19,18 @@ class Solution {
1819
v[i]=i;
1920
}
2021
vector<int>arr(n);
21-
22+
2223
arr=change(arr,v);
2324
if(arr==v){return 1;}
24-
25+
2526
int cnt=1;
26-
27+
2728
while(arr!=v){
2829
arr=change(arr,arr);
2930
cnt++;
3031
if(arr==v){return cnt;}
31-
32+
3233
}
3334
return cnt;
3435
}
35-
};
36+
};

0 commit comments

Comments
 (0)