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 9f9dc55 commit c7d2a39Copy full SHA for c7d2a39
Day14/main.go
@@ -30,23 +30,19 @@ func replaceX(in string) []string {
30
rsO1 := []rune(o1)
31
rsO2 := []rune(o2)
32
var result []string
33
- var foundX bool
34
for i, r := range rsI {
35
if r == 'X' {
36
- foundX = true
37
rsO1[i] = '0'
38
rsO2[i] = '1'
39
outSlice1 := replaceX(string(rsO1))
40
outSlice2 := replaceX(string(rsO2))
41
result = append(result, outSlice1...)
42
result = append(result, outSlice2...)
43
- break
+ return result
44
}
45
46
47
- if !foundX {
48
- result = append(result, in)
49
- }
+ result = append(result, in)
50
return result
51
52
0 commit comments