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

J, 3939 37 bytes

{{y(<:<./@#&,]@#])]1&(](,~+/\|:@|.@(,+/\@{.)@|:@|.)^:y,.@11}}

Try it online!-2 thanks to Olius's idea of using direct definition {{ }} instead of a tacit verb

YAPONA - Yet Another Port of Neil's Answer.

To save bytes, we repeat the iteration times <input> times -- which is always enough, and usually returns much more than we need -- then find the first valid number within that result.

No TIO for this one because the TIO J version is too old and doesn't have {{ }} yet. I tested locally though and it works. TIO'd tacit version below.

J, 39 bytes tacit solution with TIO

(<:<./@#&,])]1&(](,~+/\.@{.)@|:@|.),.@1

Try it online!

J, 39 bytes

(<:<./@#&,])]1&(](,~+/\.@{.)@|:@|.),.@1

Try it online!

YAPONA - Yet Another Port of Neil's Answer.

To save bytes, we repeat the iteration times -- which is always enough, and usually returns much more than we need -- then find the first valid number within that result.

J, 39 37 bytes

{{y(<:<./@#]),|:@|.@(,+/\@{:)^:y,.1}}

-2 thanks to Olius's idea of using direct definition {{ }} instead of a tacit verb

YAPONA - Yet Another Port of Neil's Answer.

To save bytes, we repeat the iteration <input> times -- which is always enough, and usually returns much more than we need -- then find the first valid number within that result.

No TIO for this one because the TIO J version is too old and doesn't have {{ }} yet. I tested locally though and it works. TIO'd tacit version below.

J, 39 bytes tacit solution with TIO

(<:<./@#&,])]1&(](,~+/\.@{.)@|:@|.),.@1

Try it online!

Source Link
Jonah
  • 33.8k
  • 4
  • 40
  • 94

J, 39 bytes

(<:<./@#&,])]1&(](,~+/\.@{.)@|:@|.),.@1

Try it online!

YAPONA - Yet Another Port of Neil's Answer.

To save bytes, we repeat the iteration times -- which is always enough, and usually returns much more than we need -- then find the first valid number within that result.