Skip to main content
added 143 characters in body
Source Link
97.100.97.109
  • 7.1k
  • 12
  • 46

Python, 7070 71 bytes

p=lambda f,n:n>9and-~p(f,(i:=lambda n:n>9and f(i(n//10),n%10)orif n>9else n)(n))

Attempt This Online!Attempt This Online!

Takes in an anonymous function f and an integer n.


+1 bytes from @xnor for noticing an error when n=0 in i.

Python, 65 bytes

p=lambda f,n:~-len(n)and-~p(f,reduce(f,n))
from functools import*

Attempt This Online!

Takes in an anonymous function f and a string n representing an integer.

Python 2, 42 bytes

p=lambda f,n:~-len(n)and-~p(f,reduce(f,n))

Attempt This Online!

Same as above. Posted based on the recommendation of @tsh.

Python, 70 bytes

p=lambda f,n:n>9and-~p(f,(i:=lambda n:n>9and f(i(n//10),n%10)or n)(n))

Attempt This Online!

Takes in an anonymous function f and an integer n.

Python, 65 bytes

p=lambda f,n:~-len(n)and-~p(f,reduce(f,n))
from functools import*

Attempt This Online!

Takes in an anonymous function f and a string n representing an integer.

Python 2, 42 bytes

p=lambda f,n:~-len(n)and-~p(f,reduce(f,n))

Attempt This Online!

Same as above. Posted based on the recommendation of @tsh.

Python, 70 71 bytes

p=lambda f,n:n>9and-~p(f,(i:=lambda n:f(i(n//10),n%10)if n>9else n)(n))

Attempt This Online!

Takes in an anonymous function f and an integer n.


+1 bytes from @xnor for noticing an error when n=0 in i.

Python, 65 bytes

p=lambda f,n:~-len(n)and-~p(f,reduce(f,n))
from functools import*

Attempt This Online!

Takes in an anonymous function f and a string n representing an integer.

Python 2, 42 bytes

p=lambda f,n:~-len(n)and-~p(f,reduce(f,n))

Attempt This Online!

Same as above. Posted based on the recommendation of @tsh.

added 430 characters in body
Source Link
97.100.97.109
  • 7.1k
  • 12
  • 46

Python, 70 bytes

p=lambda f,n:n>9and-~p(f,(i:=lambda n:n>9and f(i(n//10),n%10)or n)(n))

Attempt This Online!

Takes in an anonymous function f and an integer n.

Python, 65 bytes

p=lambda f,n:~-len(n)and-~p(f,reduce(f,n))
from functools import*

Attempt This Online!

Takes in an anonymous function f and a string n representing an integer.

Python 2, 42 bytes

p=lambda f,n:~-len(n)and-~p(f,reduce(f,n))

Attempt This Online!

Same as above. Posted based on the recommendation of @tsh.

Python, 70 bytes

p=lambda f,n:n>9and-~p(f,(i:=lambda n:n>9and f(i(n//10),n%10)or n)(n))

Attempt This Online!

Takes in an anonymous function f and an integer n.

Python, 65 bytes

p=lambda f,n:~-len(n)and-~p(f,reduce(f,n))
from functools import*

Attempt This Online!

Takes in an anonymous function f and a string n representing an integer.

Python, 70 bytes

p=lambda f,n:n>9and-~p(f,(i:=lambda n:n>9and f(i(n//10),n%10)or n)(n))

Attempt This Online!

Takes in an anonymous function f and an integer n.

Python, 65 bytes

p=lambda f,n:~-len(n)and-~p(f,reduce(f,n))
from functools import*

Attempt This Online!

Takes in an anonymous function f and a string n representing an integer.

Python 2, 42 bytes

p=lambda f,n:~-len(n)and-~p(f,reduce(f,n))

Attempt This Online!

Same as above. Posted based on the recommendation of @tsh.

added 449 characters in body
Source Link
97.100.97.109
  • 7.1k
  • 12
  • 46

Python, 70 bytes

p=lambda f,n:n>9and-~p(f,(i:=lambda n:n>9and f(i(n//10),n%10)or n)(n))

Attempt This Online!

Takes in an anonymous function f and an integer n.

Python, 65 bytes

p=lambda f,n:~-len(n)and-~p(f,reduce(f,n))
from functools import*

Attempt This Online!

Takes in an anonymous function f and a string n representing an integer.

Python, 70 bytes

p=lambda f,n:n>9and-~p(f,(i:=lambda n:n>9and f(i(n//10),n%10)or n)(n))

Attempt This Online!

Takes in an anonymous function f and an integer n.

Python, 70 bytes

p=lambda f,n:n>9and-~p(f,(i:=lambda n:n>9and f(i(n//10),n%10)or n)(n))

Attempt This Online!

Takes in an anonymous function f and an integer n.

Python, 65 bytes

p=lambda f,n:~-len(n)and-~p(f,reduce(f,n))
from functools import*

Attempt This Online!

Takes in an anonymous function f and a string n representing an integer.

added 60 characters in body
Source Link
97.100.97.109
  • 7.1k
  • 12
  • 46
Loading
Source Link
97.100.97.109
  • 7.1k
  • 12
  • 46
Loading