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

added 28 characters in body
Source Link
Kroppeb
  • 1.8k
  • 10
  • 11

Brachylog, 14(削除) 14 (削除ここまで) 11 bytes

;0{N≜↔;?≠<≜.↔¬}f(tti(

-3 bytes tanks to Fatalize

Explanation

; { }f(i(  -- Find the firstnth nnumber
 İ0 -- numbers(starting whichwith 0)
 N< -- which is positivebigger then the previous one
 ≜ -- make explicit (otherwise it will only try one number of eachfucks lengthup)
 . -- which ifis reversedthe output
 ;?≠ -- is equaland toif itselfreversed
 ¬ tt -- return last one is not the output

Try it online! Try it online!

Brachylog, 14 bytes

{N≜↔;?≠}f(tt

Explanation

; { }f( -- Find the first n
 İ -- numbers which
 N -- is positive
 ≜ -- make explicit (otherwise it will only try one number of each length)
  -- which if reversed
 ;?≠ -- is equal to itself
 tt -- return last one

Try it online!

Brachylog, (削除) 14 (削除ここまで) 11 bytes

;0{<≜.↔¬}i(

-3 bytes tanks to Fatalize

Explanation

; { }i(  -- Find the nth number
 0 -- (starting with 0)
 < -- which is bigger then the previous one
 ≜ -- make explicit (otherwise it fucks up)
 . -- which is the output
  -- and if reversed
 ¬ --  is not the output

Try it online!

Source Link
Kroppeb
  • 1.8k
  • 10
  • 11

Brachylog, 14 bytes

;İ{N≜↔;?≠}f(tt

Explanation

; { }f( -- Find the first n
 İ -- numbers which
 N -- is positive
 ≜ -- make explicit (otherwise it will only try one number of each length)
 ↔ -- which if reversed
 ;?≠ -- is equal to itself
 tt -- return last one

Try it online!

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