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 722f9ce commit 589f707Copy full SHA for 589f707
1 file changed
exercises/projecteuler/problem0024.go
@@ -23,21 +23,21 @@ func factorial(n int) int {
23
func permute(symbols string, target int) string {
24
choices := strings.Split(symbols, "")
25
answer := ""
26
- min := 0
+ minimum := 0
27
28
for len(choices) > 0 {
29
index := 0
30
combos := factorial(len(choices) - 1)
31
- min += combos
32
- for target > min {
+ minimum += combos
+ for target > minimum {
33
index += 1
34
35
}
36
answer += choices[index]
37
copy(choices[index:], choices[index+1:])
38
choices[len(choices)-1] = ""
39
choices = choices[:len(choices)-1]
40
- min -= combos
+ minimum -= combos
41
42
43
return answer
0 commit comments