add new solutions

This commit is contained in:
kanna5 2025-12-31 15:14:22 +09:00
parent 71189b61cf
commit 9c2c959a9b
Signed by: kkyy
GPG key ID: 06332F3965E9B0CF
10 changed files with 349 additions and 8 deletions

View file

@ -0,0 +1,14 @@
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