Skip to content

Commit 15d1bcb

Browse files
committed
Runtime: 486 ms (Top 14.08%) | Memory: 15.3 MB (Top 47.61%)
1 parent 6a4e245 commit 15d1bcb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

scripts/algorithms/P/Previous Permutation With One Swap/Previous Permutation With One Swap.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Runtime: 486 ms (Top 14.08%) | Memory: 15.3 MB (Top 47.61%)
12
class Solution:
23

34
def find_max(self, i, a, n):
@@ -14,7 +15,7 @@ def prevPermOpt1(self, arr):
1415
n = len(arr)
1516
for i in range(n-1, 0, -1):
1617
if(arr[i] < arr[i-1]):
17-
# sending the first descending element from right to max_function
18+
# sending the first descending element from right to max_function
1819
arr = self.find_max(i-1, arr, n)
1920
break
20-
return arr
21+
return arr

0 commit comments

Comments
 (0)