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 56 characters in body
Source Link
Leaky Nun
  • 50.6k
  • 6
  • 115
  • 291

Python 3, 90101 bytes

lambda s:g(int(s.replace(".","")),10**s[::-1].index("."))
g=lambda a,b:a-1and and(b%a and g(b%a,a)or b//a)

Try it online! Try it online!

Format: the string must havecontain a decimal point in the string.

Python 3, 90 bytes

lambda s:g(int(s.replace(".","")),10**s[::-1].index("."))
g=lambda a,b:a-1and g(b%a,a)or b

Try it online!

Format: must have a decimal point in the string.

Python 3, 101 bytes

lambda s:g(int(s.replace(".","")),10**s[::-1].index("."))
g=lambda a,b:a and(b%a and g(b%a,a)or b//a)

Try it online!

Format: the string must contain a decimal point.

Source Link
Leaky Nun
  • 50.6k
  • 6
  • 115
  • 291

Python 3, 90 bytes

lambda s:g(int(s.replace(".","")),10**s[::-1].index("."))
g=lambda a,b:a-1and g(b%a,a)or b

Try it online!

Format: must have a decimal point in the string.

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