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 23 characters in body
Source Link
chunes
  • 27.8k
  • 3
  • 32
  • 55

Uiua SBCS , 32(削除) 32 (削除ここまで) 31 bytes

⋕▽⬚0⍜⊡¬⊗@.,≥@0.⍜⊜しろいしかく(°⋕◿10∵◇⧻)<0±⌵±.

Try it! Try it!

-1 thanks to noodle man!

⋕▽⬚0⍜⊡¬⊗@.,≥@0.⍜⊜しろいしかく(°⋕◿10∵◇⧻)<0±⌵±.­⁡​‎⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠‎⁡⁠⁢⁤⁤‏‏​⁡⁠⁡‌⁢​‎⁠⁠⁠⁠⁠‎⁡⁠⁢⁤⁡‏⁠‎⁡⁠⁢⁤⁢‏⁠‎⁡⁠⁢⁤⁣‏‏​⁡⁠⁡‌⁣​‎‎⁡⁠⁤⁤‏⁠‎⁡⁠⁢⁡⁡‏⁠‎⁡⁠⁢⁡⁢‏⁠‎⁡⁠⁢⁡⁣‏⁠‎⁡⁠⁢⁣⁤‏‏​⁡⁠⁡‌⁤​‎‎⁡⁠⁢⁣⁡‏⁠‎⁡⁠⁢⁣⁢‏⁠‎⁡⁠⁢⁣⁣‏‏​⁡⁠⁡‌⁢⁡​‎‎⁡⁠⁢⁢⁢‏⁠‎⁡⁠⁢⁢⁣‏⁠‎⁡⁠⁢⁢⁤‏‏​⁡⁠⁡‌⁢⁢​‎⁠‎⁡⁠⁢⁡⁤‏⁠‎⁡⁠⁢⁢⁡‏‏​⁡⁠⁡‌⁢⁣​‎‎⁡⁠⁤⁣‏‏​⁡⁠⁡‌⁢⁤​‎⁠‎⁡⁠⁣⁤‏⁠‎⁡⁠⁤⁡‏⁠‎⁡⁠⁤⁢‏‏​⁡⁠⁡‌⁣⁡​‎‎⁡⁠⁢⁤‏⁠‎⁡⁠⁣⁡‏⁠‎⁡⁠⁣⁢‏⁠‎⁡⁠⁣⁣‏‏​⁡⁠⁡‌⁣⁢​‎‎⁡⁠⁢⁡‏⁠‎⁡⁠⁢⁢‏⁠‎⁡⁠⁢⁣‏‏​⁡⁠⁡‌⁣⁣​‎‎⁡⁠⁣‏⁠‎⁡⁠⁤‏‏​⁡⁠⁡‌⁣⁤​‎‎⁡⁠⁢‏⁠‏​⁡⁠⁡‌⁤⁡​‎‎⁡⁠⁡‏‏​⁡⁠⁡‌­
 . # ‎⁡duplicate
 <0±⌵± # ‎⁢mask of letters
 ⍜⊜しろいしかく( ) # ‎⁣apply function to each contiguous mask group
 ∵◇⧻ # ‎⁤lengths
 ◿10 # ‎⁢⁡modulo ten
 °⋕ # ‎⁢⁢unparse
 . # ‎⁢⁣duplicate
 ≥@0 # ‎⁢⁤mask of digits
 ⊗@., # ‎⁣⁡index of first period
 ⍜⊡¬ # ‎⁣⁢negate at index
 ⬚0 # ‎⁣⁣filling with zero if no period found
 ▽ # ‎⁣⁤keep characters given mask
⋕ # ‎⁤⁡parse to number, removing leading and trailing zeros
💎

Created with the help of Luminespire.

Uiua SBCS , 32 bytes

⋕▽⬚0⍜⊡¬⊗@.,≥@0.⍜⊜しろいしかく(°⋕◿10∵◇⧻)<0±.

Try it!

⋕▽⬚0⍜⊡¬⊗@.,≥@0.⍜⊜しろいしかく(°⋕◿10∵◇⧻)<0±.­⁡​‎⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠‎⁡⁠⁢⁤⁤‏‏​⁡⁠⁡‌⁢​‎⁠⁠⁠⁠⁠‎⁡⁠⁢⁤⁡‏⁠‎⁡⁠⁢⁤⁢‏⁠‎⁡⁠⁢⁤⁣‏‏​⁡⁠⁡‌⁣​‎‎⁡⁠⁤⁤‏⁠‎⁡⁠⁢⁡⁡‏⁠‎⁡⁠⁢⁡⁢‏⁠‎⁡⁠⁢⁡⁣‏⁠‎⁡⁠⁢⁣⁤‏‏​⁡⁠⁡‌⁤​‎‎⁡⁠⁢⁣⁡‏⁠‎⁡⁠⁢⁣⁢‏⁠‎⁡⁠⁢⁣⁣‏‏​⁡⁠⁡‌⁢⁡​‎‎⁡⁠⁢⁢⁢‏⁠‎⁡⁠⁢⁢⁣‏⁠‎⁡⁠⁢⁢⁤‏‏​⁡⁠⁡‌⁢⁢​‎⁠‎⁡⁠⁢⁡⁤‏⁠‎⁡⁠⁢⁢⁡‏‏​⁡⁠⁡‌⁢⁣​‎‎⁡⁠⁤⁣‏‏​⁡⁠⁡‌⁢⁤​‎⁠‎⁡⁠⁣⁤‏⁠‎⁡⁠⁤⁡‏⁠‎⁡⁠⁤⁢‏‏​⁡⁠⁡‌⁣⁡​‎‎⁡⁠⁢⁤‏⁠‎⁡⁠⁣⁡‏⁠‎⁡⁠⁣⁢‏⁠‎⁡⁠⁣⁣‏‏​⁡⁠⁡‌⁣⁢​‎‎⁡⁠⁢⁡‏⁠‎⁡⁠⁢⁢‏⁠‎⁡⁠⁢⁣‏‏​⁡⁠⁡‌⁣⁣​‎‎⁡⁠⁣‏⁠‎⁡⁠⁤‏‏​⁡⁠⁡‌⁣⁤​‎‎⁡⁠⁢‏⁠‏​⁡⁠⁡‌⁤⁡​‎‎⁡⁠⁡‏‏​⁡⁠⁡‌­
 . # ‎⁡duplicate
 <0± # ‎⁢mask of letters
 ⍜⊜しろいしかく( ) # ‎⁣apply function to each contiguous mask group
 ∵◇⧻ # ‎⁤lengths
 ◿10 # ‎⁢⁡modulo ten
 °⋕ # ‎⁢⁢unparse
 . # ‎⁢⁣duplicate
 ≥@0 # ‎⁢⁤mask of digits
 ⊗@., # ‎⁣⁡index of first period
 ⍜⊡¬ # ‎⁣⁢negate at index
 ⬚0 # ‎⁣⁣filling with zero if no period found
 ▽ # ‎⁣⁤keep characters given mask
⋕ # ‎⁤⁡parse to number, removing leading and trailing zeros
💎

Created with the help of Luminespire.

Uiua SBCS , (削除) 32 (削除ここまで) 31 bytes

⋕▽⬚0⍜⊡¬⊗@.,≥@0.⍜⊜しろいしかく(°⋕◿10∵◇⧻)⌵±.

Try it!

-1 thanks to noodle man!

⋕▽⬚0⍜⊡¬⊗@.,≥@0.⍜⊜しろいしかく(°⋕◿10∵◇⧻)⌵±.­⁡​‎⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠‎⁡⁠⁢⁤⁤‏‏​⁡⁠⁡‌⁢​‎⁠⁠⁠⁠⁠‎⁡⁠⁢⁤⁡‏⁠‎⁡⁠⁢⁤⁢‏⁠‎⁡⁠⁢⁤⁣‏‏​⁡⁠⁡‌⁣​‎‎⁡⁠⁤⁤‏⁠‎⁡⁠⁢⁡⁡‏⁠‎⁡⁠⁢⁡⁢‏⁠‎⁡⁠⁢⁡⁣‏⁠‎⁡⁠⁢⁣⁤‏‏​⁡⁠⁡‌⁤​‎‎⁡⁠⁢⁣⁡‏⁠‎⁡⁠⁢⁣⁢‏⁠‎⁡⁠⁢⁣⁣‏‏​⁡⁠⁡‌⁢⁡​‎‎⁡⁠⁢⁢⁢‏⁠‎⁡⁠⁢⁢⁣‏⁠‎⁡⁠⁢⁢⁤‏‏​⁡⁠⁡‌⁢⁢​‎⁠‎⁡⁠⁢⁡⁤‏⁠‎⁡⁠⁢⁢⁡‏‏​⁡⁠⁡‌⁢⁣​‎‎⁡⁠⁤⁣‏‏​⁡⁠⁡‌⁢⁤​‎⁠‎⁡⁠⁣⁤‏⁠‎⁡⁠⁤⁡‏⁠‎⁡⁠⁤⁢‏‏​⁡⁠⁡‌⁣⁡​‎‎⁡⁠⁢⁤‏⁠‎⁡⁠⁣⁡‏⁠‎⁡⁠⁣⁢‏⁠‎⁡⁠⁣⁣‏‏​⁡⁠⁡‌⁣⁢​‎‎⁡⁠⁢⁡‏⁠‎⁡⁠⁢⁢‏⁠‎⁡⁠⁢⁣‏‏​⁡⁠⁡‌⁣⁣​‎‎⁡⁠⁣‏⁠‎⁡⁠⁤‏‏​⁡⁠⁡‌⁣⁤​‎‎⁡⁠⁢‏⁠‏​⁡⁠⁡‌⁤⁡​‎‎⁡⁠⁡‏‏​⁡⁠⁡‌­
 . # ‎⁡duplicate
 ⌵± # ‎⁢mask of letters
 ⍜⊜しろいしかく( ) # ‎⁣apply function to each contiguous mask group
 ∵◇⧻ # ‎⁤lengths
 ◿10 # ‎⁢⁡modulo ten
 °⋕ # ‎⁢⁢unparse
 . # ‎⁢⁣duplicate
 ≥@0 # ‎⁢⁤mask of digits
 ⊗@., # ‎⁣⁡index of first period
 ⍜⊡¬ # ‎⁣⁢negate at index
 ⬚0 # ‎⁣⁣filling with zero if no period found
 ▽ # ‎⁣⁤keep characters given mask
⋕ # ‎⁤⁡parse to number, removing leading and trailing zeros
💎

Created with the help of Luminespire.

Source Link
chunes
  • 27.8k
  • 3
  • 32
  • 55

Uiua SBCS , 32 bytes

⋕▽⬚0⍜⊡¬⊗@.,≥@0.⍜⊜しろいしかく(°⋕◿10∵◇⧻)<0±.

Try it!

⋕▽⬚0⍜⊡¬⊗@.,≥@0.⍜⊜しろいしかく(°⋕◿10∵◇⧻)<0±.­⁡​‎⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠‎⁡⁠⁢⁤⁤‏‏​⁡⁠⁡‌⁢​‎⁠⁠⁠⁠⁠‎⁡⁠⁢⁤⁡‏⁠‎⁡⁠⁢⁤⁢‏⁠‎⁡⁠⁢⁤⁣‏‏​⁡⁠⁡‌⁣​‎‎⁡⁠⁤⁤‏⁠‎⁡⁠⁢⁡⁡‏⁠‎⁡⁠⁢⁡⁢‏⁠‎⁡⁠⁢⁡⁣‏⁠‎⁡⁠⁢⁣⁤‏‏​⁡⁠⁡‌⁤​‎‎⁡⁠⁢⁣⁡‏⁠‎⁡⁠⁢⁣⁢‏⁠‎⁡⁠⁢⁣⁣‏‏​⁡⁠⁡‌⁢⁡​‎‎⁡⁠⁢⁢⁢‏⁠‎⁡⁠⁢⁢⁣‏⁠‎⁡⁠⁢⁢⁤‏‏​⁡⁠⁡‌⁢⁢​‎⁠‎⁡⁠⁢⁡⁤‏⁠‎⁡⁠⁢⁢⁡‏‏​⁡⁠⁡‌⁢⁣​‎‎⁡⁠⁤⁣‏‏​⁡⁠⁡‌⁢⁤​‎⁠‎⁡⁠⁣⁤‏⁠‎⁡⁠⁤⁡‏⁠‎⁡⁠⁤⁢‏‏​⁡⁠⁡‌⁣⁡​‎‎⁡⁠⁢⁤‏⁠‎⁡⁠⁣⁡‏⁠‎⁡⁠⁣⁢‏⁠‎⁡⁠⁣⁣‏‏​⁡⁠⁡‌⁣⁢​‎‎⁡⁠⁢⁡‏⁠‎⁡⁠⁢⁢‏⁠‎⁡⁠⁢⁣‏‏​⁡⁠⁡‌⁣⁣​‎‎⁡⁠⁣‏⁠‎⁡⁠⁤‏‏​⁡⁠⁡‌⁣⁤​‎‎⁡⁠⁢‏⁠‏​⁡⁠⁡‌⁤⁡​‎‎⁡⁠⁡‏‏​⁡⁠⁡‌­
 . # ‎⁡duplicate
 <0± # ‎⁢mask of letters
 ⍜⊜しろいしかく( ) # ‎⁣apply function to each contiguous mask group
 ∵◇⧻ # ‎⁤lengths
 ◿10 # ‎⁢⁡modulo ten
 °⋕ # ‎⁢⁢unparse
 . # ‎⁢⁣duplicate
 ≥@0 # ‎⁢⁤mask of digits
 ⊗@., # ‎⁣⁡index of first period
 ⍜⊡¬ # ‎⁣⁢negate at index
 ⬚0 # ‎⁣⁣filling with zero if no period found
 ▽ # ‎⁣⁤keep characters given mask
⋕ # ‎⁤⁡parse to number, removing leading and trailing zeros
💎

Created with the help of Luminespire.

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