Skip to main content
deleted 17 characters in body
Source Link
Dennis
  • 210.6k
  • 41
  • 370
  • 825

J (safe)

0 0 0 0 1 9 495 1287 3003 6435 12870 24310 43758 0 0 0 0 45 165

Range ≤ 8

Solution

8!/:#:!9

Try it online.

How it works

  • !9 calculates the factorial of 9, i.e., 362880.

  • #: converts the result to binary, yielding 1 0 1 1 0 0 0 1 0 0 1 1 0 0 0 0 0 0 0.

  • /: "grades up", i.e., it sorts the indices of the array from above list by the array's values at those indices.

    This yields 1 4 5 6 8 9 12 13 14 15 16 17 18 0 2 3 7 10 11.

  • 8! calculates nC8 for each n from above, returning the specified output.

J (safe)

0 0 0 0 1 9 495 1287 3003 6435 12870 24310 43758 0 0 0 0 45 165

Range ≤ 8

Solution

8!/:#:!9

Try it online.

How it works

  • !9 calculates the factorial of 9, i.e., 362880.

  • #: converts the result to binary, yielding 1 0 1 1 0 0 0 1 0 0 1 1 0 0 0 0 0 0 0.

  • /: "grades up", i.e., it sorts the indices of the array from above by the array's values at those indices.

    This yields 1 4 5 6 8 9 12 13 14 15 16 17 18 0 2 3 7 10 11.

  • 8! calculates nC8 for each n from above, returning the specified output.

J (safe)

0 0 0 0 1 9 495 1287 3003 6435 12870 24310 43758 0 0 0 0 45 165

Range ≤ 8

Solution

8!/:#:!9

Try it online.

How it works

  • !9 calculates the factorial of 9, i.e., 362880.

  • #: converts the result to binary, yielding 1 0 1 1 0 0 0 1 0 0 1 1 0 0 0 0 0 0 0.

  • /: "grades up", i.e., sorts the indices of the above list by the values at those indices.

    This yields 1 4 5 6 8 9 12 13 14 15 16 17 18 0 2 3 7 10 11.

  • 8! calculates nC8 for each n from above, returning the specified output.

added 688 characters in body
Source Link
Dennis
  • 210.6k
  • 41
  • 370
  • 825

JJ (safe)

0 0 0 0 1 9 495 1287 3003 6435 12870 24310 43758 0 0 0 0 45 165

Range ≤ 8

Solution

8!/:#:!9

Try it online.

How it works

  • !9 calculates the factorial of 9, i.e., 362880.

  • #: converts the result to binary, yielding 1 0 1 1 0 0 0 1 0 0 1 1 0 0 0 0 0 0 0.

  • /: "grades up", i.e., it sorts the indices of the array from above by the array's values at those indices.

    This yields 1 4 5 6 8 9 12 13 14 15 16 17 18 0 2 3 7 10 11.

  • 8! calculates nC8 for each n from above, returning the specified output.

J

0 0 0 0 1 9 495 1287 3003 6435 12870 24310 43758 0 0 0 0 45 165

Range ≤ 8

J (safe)

0 0 0 0 1 9 495 1287 3003 6435 12870 24310 43758 0 0 0 0 45 165

Range ≤ 8

Solution

8!/:#:!9

Try it online.

How it works

  • !9 calculates the factorial of 9, i.e., 362880.

  • #: converts the result to binary, yielding 1 0 1 1 0 0 0 1 0 0 1 1 0 0 0 0 0 0 0.

  • /: "grades up", i.e., it sorts the indices of the array from above by the array's values at those indices.

    This yields 1 4 5 6 8 9 12 13 14 15 16 17 18 0 2 3 7 10 11.

  • 8! calculates nC8 for each n from above, returning the specified output.

Source Link
Dennis
  • 210.6k
  • 41
  • 370
  • 825

J

0 0 0 0 1 9 495 1287 3003 6435 12870 24310 43758 0 0 0 0 45 165

Range ≤ 8