Skip to main content
Commonmark migration
Source Link

Jelly, 6 3 bytes

-3 bytes by having I/O as a decimal list of digits.

ṫTṪ

Test suite at Try it online!

How?

ṫTṪ - Main link: listOfDigits  e.g.  [1,    0,    2,    0]  or [1,      1,    9  ]
 T  - truthy indexes                 [1,          3      ]     [1,      2,    3  ]
ṫ   - tail (vectorises)              [[1,0,2,0],  [2,0]  ]     [[1,1,9],[1,9],[9]]
  Ṫ - tail pop                                    [2,0]                       [9]

If we could not take decimal lists a 6 byter is:

DµṫTṪḌ

Which you can see here.

This does the same thing, but converts an integer to a decimal list beforehand and converts back to an integer afterwards.

Jelly, 6 3 bytes

-3 bytes by having I/O as a decimal list of digits.

ṫTṪ

Test suite at Try it online!

How?

ṫTṪ - Main link: listOfDigits  e.g.  [1,    0,    2,    0]  or [1,      1,    9  ]
 T  - truthy indexes                 [1,          3      ]     [1,      2,    3  ]
ṫ   - tail (vectorises)              [[1,0,2,0],  [2,0]  ]     [[1,1,9],[1,9],[9]]
  Ṫ - tail pop                                    [2,0]                       [9]

If we could not take decimal lists a 6 byter is:

DµṫTṪḌ

Which you can see here.

This does the same thing, but converts an integer to a decimal list beforehand and converts back to an integer afterwards.

Jelly, 6 3 bytes

-3 bytes by having I/O as a decimal list of digits.

ṫTṪ

Test suite at Try it online!

How?

ṫTṪ - Main link: listOfDigits  e.g.  [1,    0,    2,    0]  or [1,      1,    9  ]
 T  - truthy indexes                 [1,          3      ]     [1,      2,    3  ]
ṫ   - tail (vectorises)              [[1,0,2,0],  [2,0]  ]     [[1,1,9],[1,9],[9]]
  Ṫ - tail pop                                    [2,0]                       [9]

If we could not take decimal lists a 6 byter is:

DµṫTṪḌ

Which you can see here.

This does the same thing, but converts an integer to a decimal list beforehand and converts back to an integer afterwards.

replaced http://codegolf.stackexchange.com/ with https://codegolf.stackexchange.com/
Source Link

Jelly, 6 3 bytes

-3 bytes by having I/O as a decimal list of digitsdecimal list of digits.

ṫTṪ

Test suite at Try it online!

How?

ṫTṪ - Main link: listOfDigits  e.g.  [1,    0,    2,    0]  or [1,      1,    9  ]
 T  - truthy indexes                 [1,          3      ]     [1,      2,    3  ]
ṫ   - tail (vectorises)              [[1,0,2,0],  [2,0]  ]     [[1,1,9],[1,9],[9]]
  Ṫ - tail pop                                    [2,0]                       [9]

If we could not take decimal lists a 6 byter is:

DµṫTṪḌ

Which you can see here.

This does the same thing, but converts an integer to a decimal list beforehand and converts back to an integer afterwards.

Jelly, 6 3 bytes

-3 bytes by having I/O as a decimal list of digits.

ṫTṪ

Test suite at Try it online!

How?

ṫTṪ - Main link: listOfDigits  e.g.  [1,    0,    2,    0]  or [1,      1,    9  ]
 T  - truthy indexes                 [1,          3      ]     [1,      2,    3  ]
ṫ   - tail (vectorises)              [[1,0,2,0],  [2,0]  ]     [[1,1,9],[1,9],[9]]
  Ṫ - tail pop                                    [2,0]                       [9]

If we could not take decimal lists a 6 byter is:

DµṫTṪḌ

Which you can see here.

This does the same thing, but converts an integer to a decimal list beforehand and converts back to an integer afterwards.

Jelly, 6 3 bytes

-3 bytes by having I/O as a decimal list of digits.

ṫTṪ

Test suite at Try it online!

How?

ṫTṪ - Main link: listOfDigits  e.g.  [1,    0,    2,    0]  or [1,      1,    9  ]
 T  - truthy indexes                 [1,          3      ]     [1,      2,    3  ]
ṫ   - tail (vectorises)              [[1,0,2,0],  [2,0]  ]     [[1,1,9],[1,9],[9]]
  Ṫ - tail pop                                    [2,0]                       [9]

If we could not take decimal lists a 6 byter is:

DµṫTṪḌ

Which you can see here.

This does the same thing, but converts an integer to a decimal list beforehand and converts back to an integer afterwards.

added 177 characters in body
Source Link
Jonathan Allan
  • 110.1k
  • 7
  • 65
  • 282

Jelly, 6 3 bytes

-3 bytes by having I/O as a decimal list of digits.

ṫTṪ

Test suite at Try it online!

How?

ṫTṪ - Main link: listOfDigits  e.g.  [1,    0,    2,    0]  or [1,      1,    9  ]
 T  - truthy indexes                 [1,          3      ]     [1,      2,    3  ]
ṫ   - tail (vectorises)              [[1,0,2,0],  [2,0]  ]     [[1,1,9],[1,9],[9]]
  Ṫ - tail pop                                    [2,0]                       [9]

If we could not take decimal lists a 6 byter is:

DµṫTḌṂDµṫTṪḌ

Which you can see herehere.

This does the same thing, but converts an integer to a decimal list beforehand and converts back to an integer afterwards.

Jelly, 6 3 bytes

-3 bytes by having I/O as a decimal list of digits.

ṫTṪ

Test suite at Try it online!


If we could not take decimal lists a 6 byter is:

DµṫTḌṂ

Which you can see here.

Jelly, 6 3 bytes

-3 bytes by having I/O as a decimal list of digits.

ṫTṪ

Test suite at Try it online!

How?

ṫTṪ - Main link: listOfDigits  e.g.  [1,    0,    2,    0]  or [1,      1,    9  ]
 T  - truthy indexes                 [1,          3      ]     [1,      2,    3  ]
ṫ   - tail (vectorises)              [[1,0,2,0],  [2,0]  ]     [[1,1,9],[1,9],[9]]
  Ṫ - tail pop                                    [2,0]                       [9]

If we could not take decimal lists a 6 byter is:

DµṫTṪḌ

Which you can see here.

This does the same thing, but converts an integer to a decimal list beforehand and converts back to an integer afterwards.

added 177 characters in body
Source Link
Jonathan Allan
  • 110.1k
  • 7
  • 65
  • 282
Loading
added 177 characters in body
Source Link
Jonathan Allan
  • 110.1k
  • 7
  • 65
  • 282
Loading
Source Link
Jonathan Allan
  • 110.1k
  • 7
  • 65
  • 282
Loading