Skip to main content
Commonmark migration
Source Link

#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

Try it


Explanation

##Explanation ImplicitImplicit input of array U and integer 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 Vth element of U, beginning at index X.

x

Reduce that array by addition.

#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

Try it


##Explanation Implicit input of array U and integer 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 Vth element of U, beginning at index X.

x

Reduce that array by addition.

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

Try it


Explanation

Implicit input of array U and integer 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 Vth element of U, beginning at index X.

x

Reduce that array by addition.

deleted 71 characters in body
Source Link
Shaggy
  • 43.5k
  • 4
  • 36
  • 94

#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!

Takes input in reverse order (although doing so doesn't save any bytes).

ÆVëUXVÆëVX x

Try itTry it


##Explanation Implicit input of integerarray U and arrayinteger V.

Æ

Generate an array of integers from 0 to UV-1 and pass each through a function with X being the current element.

VëUXëVX

Grab every UVth element of VU, beginning at index X.

x

Reduce that array by addition.

#Japt, 7 bytes

Man, I fought with the wrong method for far too long trying to get it to work for the [1], 3 test case in a reasonable amount of bytes!

Takes input in reverse order (although doing so doesn't save any bytes).

ÆVëUX x

Try it


##Explanation Implicit input of integer U and array V.

Æ

Generate an array of integers from 0 to U-1 and pass each through a function with X being the current element.

VëUX

Grab every Uth element of V, beginning at index X.

x

Reduce that array by addition.

#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

Try it


##Explanation Implicit input of array U and integer 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 Vth element of U, beginning at index X.

x

Reduce that array by addition.

deleted 4 characters in body
Source Link
Shaggy
  • 43.5k
  • 4
  • 36
  • 94

#Japt, 7 bytes

Man, I fought with the wrong method for far too long, trying to get thisit to work withfor the [1], 3 test case in a reasonable amount of bytes!

Takes input in reverse order (although doing so doesn't save any bytes).

ÆVëUX x

Try it


##Explanation Implicit input of integer U and array V.

Æ

Generate an array of integers from 0 to U-1 and pass each through a function with X being the current element.

VëUX

Grab every Uth element of V, beginning at index X.

x

Reduce that array by addition.

#Japt, 7 bytes

Man, I fought with the wrong method for far too long, trying to get this to work with the [1], 3 test case in a reasonable amount of bytes!

Takes input in reverse order (although doing so doesn't save any bytes).

ÆVëUX x

Try it


##Explanation Implicit input of integer U and array V.

Æ

Generate an array of integers from 0 to U-1 and pass each through a function with X being the current element.

VëUX

Grab every Uth element of V, beginning at index X.

x

Reduce that array by addition.

#Japt, 7 bytes

Man, I fought with the wrong method for far too long trying to get it to work for the [1], 3 test case in a reasonable amount of bytes!

Takes input in reverse order (although doing so doesn't save any bytes).

ÆVëUX x

Try it


##Explanation Implicit input of integer U and array V.

Æ

Generate an array of integers from 0 to U-1 and pass each through a function with X being the current element.

VëUX

Grab every Uth element of V, beginning at index X.

x

Reduce that array by addition.

Source Link
Shaggy
  • 43.5k
  • 4
  • 36
  • 94
Loading