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

)
Source Link
Uriel
  • 13.3k
  • 4
  • 18
  • 45

APL (Dyalog), 11(削除) 11 (削除ここまで) 8 bytes

3 bytes saved thanks to @Bubbler!

'⊃'(|)D'⍳ ̄1∘↑'⍳⌽

Try it online! Try it online!

 ⌽ reverse the string
⊃ take the last (now first) byte
 '(|)'⍳ index inside '(|)' (if not found ('D') returns the length (3))

APL (Dyalog), 11 bytes

'(|)D'⍳ ̄1∘↑

Try it online!

APL (Dyalog), (削除) 11 (削除ここまで) 8 bytes

3 bytes saved thanks to @Bubbler!

⊃'(|)'⍳⌽

Try it online!

 ⌽ reverse the string
⊃ take the last (now first) byte
 '(|)'⍳ index inside '(|)' (if not found ('D') returns the length (3))
added 11 characters in body
Source Link
Uriel
  • 13.3k
  • 4
  • 18
  • 45

APL (Dyalog), 1011 bytes

'(|)D'⍳1∘↓D'⍳ ̄1∘↑

Try it online! Try it online!

APL (Dyalog), 10 bytes

'(|)D'⍳1∘↓

Try it online!

APL (Dyalog), 11 bytes

'(|)D'⍳ ̄1∘↑

Try it online!

Source Link
Uriel
  • 13.3k
  • 4
  • 18
  • 45

APL (Dyalog), 10 bytes

'(|)D'⍳1∘↓

Try it online!

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