You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
lavos/cap3/work12.go

24 lines
476 B

package cap3
func Work12() []int {
size := 52
cardStatus := make([]bool, 52)
start, count := 2, 0
for count <= 104 {
for j := start; j < size; j++ {
if j%start == 0 {
cardStatus[j] = !cardStatus[j]
count++
}
}
}
result := make([]int, 0)
for i, faceDown := range cardStatus {
if !faceDown {
result = append(result, i)
}
}
return result
}