add new solutions
This commit is contained in:
parent
ca24d0a56a
commit
0c73608ce5
36 changed files with 791 additions and 0 deletions
19
solutions/32/q3289/solution.go
Normal file
19
solutions/32/q3289/solution.go
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
package q3289
|
||||
|
||||
func getSneakyNumbers(nums []int) []int {
|
||||
ret := [2]int{}
|
||||
p := 0
|
||||
|
||||
for _, num := range nums {
|
||||
num %= 1000
|
||||
if nums[num] >= 1000 {
|
||||
ret[p] = num
|
||||
p++
|
||||
} else {
|
||||
nums[num] += 1000
|
||||
}
|
||||
}
|
||||
return ret[:]
|
||||
}
|
||||
|
||||
var _ = getSneakyNumbers
|
||||
Loading…
Add table
Add a link
Reference in a new issue