Skip to content

Commit 589f707

Browse files
author
Gonzalo Diaz
committed
[REFACTOR] [BUGFIX] Codefactor: Redefinition of the built-in function min.
1 parent 722f9ce commit 589f707

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

exercises/projecteuler/problem0024.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,21 @@ func factorial(n int) int {
2323
func permute(symbols string, target int) string {
2424
choices := strings.Split(symbols, "")
2525
answer := ""
26-
min := 0
26+
minimum := 0
2727

2828
for len(choices) > 0 {
2929
index := 0
3030
combos := factorial(len(choices) - 1)
31-
min += combos
32-
for target > min {
31+
minimum += combos
32+
for target > minimum {
3333
index += 1
34-
min += combos
34+
minimum += combos
3535
}
3636
answer += choices[index]
3737
copy(choices[index:], choices[index+1:])
3838
choices[len(choices)-1] = ""
3939
choices = choices[:len(choices)-1]
40-
min -= combos
40+
minimum -= combos
4141
}
4242

4343
return answer

0 commit comments

Comments
 (0)