Skip to main content
added 107 characters in body
Source Link
Jonah
  • 33.8k
  • 4
  • 40
  • 94

J, 32 26 2323 16 bytes

24 60 60*/ .>(3$100)&#:>100#.inv]

Try it online!Try it online!

-916 bytes (!!) thanks to Adam. This new solution uses the approach from his APL answer so be sure to upvote that.

Convert the input to base 100, taking only the last 3 digits (this is how mixed base #: works), check that all of themdigits are withinless than 60.

Note the most significant digit is guaranteed to be less than 24 by the allowed rangeinputs.

J, 32 26 23 bytes

24 60 60*/ .>(3$100)&#:

Try it online!

-9 bytes thanks to Adam. This new solution uses the approach from his APL answer so be sure to upvote that.

Convert the input to base 100, taking only the last 3 digits (this is how mixed base #: works), check that all of them are within the allowed range.

J, 32 26 23 16 bytes

60*/ .>100#.inv]

Try it online!

-16 bytes (!!) thanks to Adam. This new solution uses the approach from his APL answer so be sure to upvote that.

Convert the input to base 100, check that all digits are less than 60.

Note the most significant digit is guaranteed to be less than 24 by the allowed inputs.

added 139 characters in body
Source Link
Jonah
  • 33.8k
  • 4
  • 40
  • 94

J, 32 2626 23 bytes

24 60 60*/ .>_3{.100&#.inv>(3$100)&#:

Try it online!Try it online!

-69 bytes thanks to Adam. This new solution uses the approach from his APL answer so be sure to upvote that.

Convert the input to base 100, taketaking only the last 3 digits (this is how mixed base #: works), check that all of them are within the allowed range.

J, 32 26 bytes

24 60 60*/ .>_3{.100&#.inv

Try it online!

-6 bytes thanks to Adam

Convert the input to base 100, take the last 3 digits, check that all of them are within the allowed range.

J, 32 26 23 bytes

24 60 60*/ .>(3$100)&#:

Try it online!

-9 bytes thanks to Adam. This new solution uses the approach from his APL answer so be sure to upvote that.

Convert the input to base 100, taking only the last 3 digits (this is how mixed base #: works), check that all of them are within the allowed range.

added 40 characters in body
Source Link
Jonah
  • 33.8k
  • 4
  • 40
  • 94

J, 3232 26 bytes

[:*/24 60 60>_2"60*/ .\_6>_3{.'00000',":100&#.inv

Try it online!Try it online!

Prepend '00000' to-6 bytes thanks to Adam

Convert the stringified intinput to base 100, take the last 6 _6{., format them in groups of 2 _2".\3 digits, and make surecheck that all chunksof them are inwithin the correctallowed range.

J, 32 bytes

[:*/24 60 60>_2".\_6{.'00000',":

Try it online!

Prepend '00000' to the stringified int, take the last 6 _6{., format them in groups of 2 _2".\, and make sure all chunks are in the correct range.

J, 32 26 bytes

24 60 60*/ .>_3{.100&#.inv

Try it online!

-6 bytes thanks to Adam

Convert the input to base 100, take the last 3 digits, check that all of them are within the allowed range.

added 154 characters in body
Source Link
Jonah
  • 33.8k
  • 4
  • 40
  • 94
Loading
Source Link
Jonah
  • 33.8k
  • 4
  • 40
  • 94
Loading