lc-go/solutions/9/q961/solution.go
2026-01-04 14:44:06 +09:00

14 lines
219 B
Go

package q961
import "math/rand"
func repeatedNTimes(nums []int) int {
for {
a, b := rand.Intn(len(nums)), rand.Intn(len(nums))
if b != a && nums[a] == nums[b] {
return nums[a]
}
}
}
var _ = repeatedNTimes