Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

deleted 5 characters in body
Source Link
Jonah
  • 34.1k
  • 4
  • 41
  • 95

J, 43 bytes

".e.-@-:@#((0<[:".{:\)*[:*/".\)"1 i.@!@#A.]

Try it online! Try it online!

Takes digits as a string.

For each permutation i.@!@#A.], use half the digit length -@-:@# to take non-overlapping infixes -- which slices into 2 halves -- and multiply those halves([:*/".\)"1. CheckThen (to handle the trailing zero constraint) multiply that by (0<[:".{:\)*, which takes the last digits of each half, cats them, evaluates that as a two digit number, and checks if it's greater than 0.

Finally, check if the input number ". is an element of that list e..

J, 43 bytes

".e.-@-:@#((0<[:".{:\)*[:*/".\)"1 i.@!@#A.]

Try it online!

Takes digits as a string.

For each permutation i.@!@#A.], use half the digit length -@-:@# to take non-overlapping infixes -- which slices into 2 halves -- and multiply those halves([:*/".\)"1. Check if the input number ". is an element of that list e..

J, 43 bytes

".e.-@-:@#((0<[:".{:\)*[:*/".\)"1 i.@!@#A.]

Try it online!

Takes digits as a string.

For each permutation i.@!@#A.], use half the digit length -@-:@# to take non-overlapping infixes -- which slices into 2 halves -- and multiply those halves([:*/".\)"1. Then (to handle the trailing zero constraint) multiply that by (0<[:".{:\)*, which takes the last digits of each half, cats them, evaluates that as a two digit number, and checks if it's greater than 0.

Finally, check if the input number ". is an element of that list e..

deleted 5 characters in body
Source Link
Jonah
  • 34.1k
  • 4
  • 41
  • 95

J, 4643 bytes

".e.-@-:@#([:((0<[:+/10&|".{:\)***[:*/)".\)"1 i.@!@#A.]

Try it online! Try it online!

Takes digits as a string.

For each permutation i.@!@#A.], use half the digit length -@-:@# to take non-overlapping infixes -- which slices into 2 halves -- and multiply those halves([:*/".\)"1. Check if the input number ". is an element of that list e..

J, 46 bytes

".e.-@-:@#([:((0<[:+/10&|)**/)".\)"1 i.@!@#A.]

Try it online!

Takes digits as a string.

For each permutation i.@!@#A.], use half the digit length -@-:@# to take non-overlapping infixes -- which slices into 2 halves -- and multiply those halves([:*/".\)"1. Check if the input number ". is an element of that list e..

J, 43 bytes

".e.-@-:@#((0<[:".{:\)*[:*/".\)"1 i.@!@#A.]

Try it online!

Takes digits as a string.

For each permutation i.@!@#A.], use half the digit length -@-:@# to take non-overlapping infixes -- which slices into 2 halves -- and multiply those halves([:*/".\)"1. Check if the input number ". is an element of that list e..

added 47 characters in body
Source Link
Jonah
  • 34.1k
  • 4
  • 41
  • 95

J, 3146 bytes

".e.-@-:@#([:*((0<[:+/10&|)**/)".\)"1 i.@!@#A.]

Try it online! Try it online!

Takes digits as a string.

For each permutation i.@!@#A.], use half the digit length -@-:@# to take non-overlapping infixes -- which slices into 2 halves -- and multiply those halves([:*/".\)"1. Check if the input number ". is an element of that list e..

J, 31 bytes

".e.-@-:@#([:*/".\)"1 i.@!@#A.]

Try it online!

Takes digits as a string.

For each permutation i.@!@#A.], use half the digit length -@-:@# to take non-overlapping infixes -- which slices into 2 halves -- and multiply those halves([:*/".\)"1. Check if the input number ". is an element of that list e..

J, 46 bytes

".e.-@-:@#([:((0<[:+/10&|)**/)".\)"1 i.@!@#A.]

Try it online!

Takes digits as a string.

For each permutation i.@!@#A.], use half the digit length -@-:@# to take non-overlapping infixes -- which slices into 2 halves -- and multiply those halves([:*/".\)"1. Check if the input number ". is an element of that list e..

added 3 characters in body
Source Link
Jonah
  • 34.1k
  • 4
  • 41
  • 95
Loading
added 93 characters in body
Source Link
Jonah
  • 34.1k
  • 4
  • 41
  • 95
Loading
Source Link
Jonah
  • 34.1k
  • 4
  • 41
  • 95
Loading

AltStyle によって変換されたページ (->オリジナル) /