add new solutions

This commit is contained in:
Yiyang Kang 2026-02-09 10:55:02 +09:00
parent 51975f3386
commit 489fa73880
Signed by: kkyy
SSH key fingerprint: SHA256:lJSbAzC3MvrSORdvIVK6h/3g+rVKJNzM7zq0MgA9WKY
13 changed files with 437 additions and 3 deletions

View file

@ -0,0 +1,17 @@
package q3379
func constructTransformedArray(nums []int) []int {
n := len(nums)
ret := make([]int, n)
for i, num := range nums {
num = (i + num) % n
if num < 0 {
num += n
}
ret[i] = nums[num]
}
return ret
}
var _ = constructTransformedArray