File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -26,16 +26,19 @@ def fannkuch(n: int) -> int:
26
26
perm : List [int ] = list (range (n ))
27
27
perm1_ins : Callable [[int , int ], None ] = perm1 .insert
28
28
perm1_pop : Callable [[int ], int ] = perm1 .pop
29
+ ### SHALLOW SEPARATOR ###
29
30
30
31
while 1 :
31
32
while r != 1 :
32
33
count [r - 1 ] = r
33
34
r -= 1
34
35
36
+ ### SHALLOW SEPARATOR ###
35
37
if perm1 [0 ] != 0 and perm1 [m ] != m :
36
38
perm = perm1 [:]
37
39
flips_count : int = 0
38
40
k : int = perm [0 ]
41
+ ### SHALLOW SEPARATOR ###
39
42
while k :
40
43
perm [: k + 1 ] = perm [k ::- 1 ]
41
44
flips_count += 1
Original file line number Diff line number Diff line change @@ -22,16 +22,19 @@ def fannkuch(n):
22
22
perm = list (range (n ))
23
23
perm1_ins = perm1 .insert
24
24
perm1_pop = perm1 .pop
25
+ ### SHALLOW SEPARATOR ###
25
26
26
27
while 1 :
27
28
while r != 1 :
28
29
count [r - 1 ] = r
29
30
r -= 1
30
31
32
+ ### SHALLOW SEPARATOR ###
31
33
if perm1 [0 ] != 0 and perm1 [m ] != m :
32
34
perm = perm1 [:]
33
35
flips_count = 0
34
36
k = perm [0 ]
37
+ ### SHALLOW SEPARATOR ###
35
38
while k :
36
39
perm [: k + 1 ] = perm [k ::- 1 ]
37
40
flips_count += 1
You can’t perform that action at this time.
0 commit comments