#Japt, 7 bytes
Japt, 7 bytes
Man, I fought with the wrong Japt method for far too long trying to get it to work for the [1], 3
test case in a reasonable amount of bytes!
VÆëVX x
Explanation
##Explanation
ImplicitImplicit input of array U
and integer V
.
VÆ
Generate an array of integers from 0
to V-1
and pass each through a function with X
being the current element.
ëVX
Grab every V
th element of U
, beginning at index X
.
x
Reduce that array by addition.