Skip to main content
Commonmark migration
Source Link

#JavaScript (ES6), 21 bytes

JavaScript (ES6), 21 bytes

Takes input as (k)(n).

k=>g=n=>n<1||n*g(n-k) 

Try it online!

Or 24 bytes to support BigInts.


#JavaScript (ES6), 55 bytes

JavaScript (ES6), 55 bytes

Takes input as a string, using the format described in the challenge.

s=>(a=s.split`!`,k=a.length-1,g=n=>n<1||n*g(n-k))(a[0]) 

Try it online!

#JavaScript (ES6), 21 bytes

Takes input as (k)(n).

k=>g=n=>n<1||n*g(n-k) 

Try it online!

Or 24 bytes to support BigInts.


#JavaScript (ES6), 55 bytes

Takes input as a string, using the format described in the challenge.

s=>(a=s.split`!`,k=a.length-1,g=n=>n<1||n*g(n-k))(a[0]) 

Try it online!

JavaScript (ES6), 21 bytes

Takes input as (k)(n).

k=>g=n=>n<1||n*g(n-k) 

Try it online!

Or 24 bytes to support BigInts.


JavaScript (ES6), 55 bytes

Takes input as a string, using the format described in the challenge.

s=>(a=s.split`!`,k=a.length-1,g=n=>n<1||n*g(n-k))(a[0]) 

Try it online!

added a link to a BigInt version
Source Link
Arnauld
  • 205.5k
  • 21
  • 187
  • 670

#JavaScript (ES6), 21 bytes

Takes input as (k)(n).

k=>g=n=>n<1||n*g(n-k) 

Try it online!

Or 24 bytes to support BigInts.


#JavaScript (ES6), 55 bytes

Takes input as a string, using the format described in the challenge.

s=>(a=s.split`!`,k=a.length-1,g=n=>n<1||n*g(n-k))(a[0]) 

Try it online!

#JavaScript (ES6), 21 bytes

Takes input as (k)(n).

k=>g=n=>n<1||n*g(n-k) 

Try it online!


#JavaScript (ES6), 55 bytes

Takes input as a string, using the format described in the challenge.

s=>(a=s.split`!`,k=a.length-1,g=n=>n<1||n*g(n-k))(a[0]) 

Try it online!

#JavaScript (ES6), 21 bytes

Takes input as (k)(n).

k=>g=n=>n<1||n*g(n-k) 

Try it online!

Or 24 bytes to support BigInts.


#JavaScript (ES6), 55 bytes

Takes input as a string, using the format described in the challenge.

s=>(a=s.split`!`,k=a.length-1,g=n=>n<1||n*g(n-k))(a[0]) 

Try it online!

saved some bytes on both versions
Source Link
Arnauld
  • 205.5k
  • 21
  • 187
  • 670

#JavaScript (ES6), 2521 bytes

Takes input as (k)(n).

k=>g=n=>n>k?n*gk=>g=n=>n<1||n*g(n-k):n|!n 

Try it online!

Or 26 bytes to support BigInts.Try it online!


#JavaScript (ES6), 5955 bytes

Takes input as a string, using the format described in the challenge.

s=>(a=s.split`!`,k=a.length-1,g=n=>n*=n<k||gg=n=>n<1||n*g(n-k+1k))(a[0])||1 

Try it online!Try it online!

#JavaScript (ES6), 25 bytes

Takes input as (k)(n).

k=>g=n=>n>k?n*g(n-k):n|!n 

Try it online!

Or 26 bytes to support BigInts.


#JavaScript (ES6), 59 bytes

Takes input as a string, using the format described in the challenge.

s=>(a=s.split`!`,k=a.length,g=n=>n*=n<k||g(n-k+1))(a[0])||1 

Try it online!

#JavaScript (ES6), 21 bytes

Takes input as (k)(n).

k=>g=n=>n<1||n*g(n-k) 

Try it online!


#JavaScript (ES6), 55 bytes

Takes input as a string, using the format described in the challenge.

s=>(a=s.split`!`,k=a.length-1,g=n=>n<1||n*g(n-k))(a[0]) 

Try it online!

Source Link
Arnauld
  • 205.5k
  • 21
  • 187
  • 670
Loading