Skip to main content
added 25 characters in body
Source Link
Razetime
  • 27.4k
  • 3
  • 29
  • 72

APL (Dyalog Unicode), 3131 25 bytes

+/1 1⍉{x+1⍉+.×⍵}⍣×⍣(⎕-1)⊢x←⌽∘⍨⌽∘.≤⍨⍳1+⎕

Try it online!Try it online!

A full program which takes N, then M as inputs.

Follows the same algorithm as xnor's Python solution.

-6 bytes from Bubbler.

APL (Dyalog Unicode), 31 bytes

+/1 1⍉{x+.×⍵}⍣(⎕-1)⊢x←⌽∘.≤⍨⍳1+⎕

Try it online!

A full program which takes N, then M as inputs.

Follows the same algorithm as xnor's Python solution.

APL (Dyalog Unicode), 31 25 bytes

+/1 1⍉+.×⍣(⎕-1)⍨⌽∘.≤⍨⍳1+⎕

Try it online!

A full program which takes N, then M as inputs.

Follows the same algorithm as xnor's Python solution.

-6 bytes from Bubbler.

Source Link
Razetime
  • 27.4k
  • 3
  • 29
  • 72

APL (Dyalog Unicode), 31 bytes

+/1 1⍉{x+.×⍵}⍣(⎕-1)⊢x←⌽∘.≤⍨⍳1+⎕

Try it online!

A full program which takes N, then M as inputs.

Follows the same algorithm as xnor's Python solution.