Skip to main content
added 32 characters in body
Source Link
Noodle9
  • 20.4k
  • 3
  • 23
  • 47

Python 3Python 2, 72 \$\cdots\$ 4643 4342 bytes

Saved 7 bytes thanks to the man himself Arnauld!!!
Saved 33 4 bytes thanks to dingledooper!!!

f=lambda l:l>[]!=1/lenl>[]>1>=len(l)>=l*l.pop()and-~f(l) 

Try it online!Try it online!

Assumes the input is sorted from highest to lowest.

Python 3, 72 \$\cdots\$ 46 43 bytes

Saved 7 bytes thanks to the man himself Arnauld!!!
Saved 3 bytes thanks to dingledooper!!!

f=lambda l:l>[]!=1/len(l)>=l.pop()and-~f(l) 

Try it online!

Assumes the input is sorted from highest to lowest.

Python 2, 72 \$\cdots\$ 43 42 bytes

Saved 7 bytes thanks to the man himself Arnauld!!!
Saved 3 4 bytes thanks to dingledooper!!!

f=lambda l:l>[]>1>=len(l)*l.pop()and-~f(l) 

Try it online!

Assumes the input is sorted from highest to lowest.

added 107 characters in body
Source Link
Noodle9
  • 20.4k
  • 3
  • 23
  • 47

Python 3, 72 \$\cdots\$ 4846 4643 bytes

Saved 7 bytes thanks to the man himself Arnauld!!!
Saved 3 bytes thanks to dingledooper!!!

f=lambda l:l>[]and 1l>[]!=1/len(l)>=l.pop()and 1+f-~f(l) 

Try it online!Try it online!

Assumes the input is sorted from highest to lowest.

Python 3, 72 \$\cdots\$ 48 46 bytes

Saved 7 bytes thanks to the man himself Arnauld!!!

f=lambda l:l>[]and 1/len(l)>=l.pop()and 1+f(l) 

Try it online!

Assumes the input is sorted from highest to lowest.

Python 3, 72 \$\cdots\$ 46 43 bytes

Saved 7 bytes thanks to the man himself Arnauld!!!
Saved 3 bytes thanks to dingledooper!!!

f=lambda l:l>[]!=1/len(l)>=l.pop()and-~f(l) 

Try it online!

Assumes the input is sorted from highest to lowest.

added 1 character in body
Source Link
Noodle9
  • 20.4k
  • 3
  • 23
  • 47

Python 3, 72 \$\cdots\$ 5548 4846 bytes

Saved 7 bytes thanks to the man himself Arnauld!!!

f=lambda l:len(l)andl>[]and 1/len(l)>=l.pop()and 1+f(l) 

Try it online!Try it online!

Assumes the input is sorted from highest to lowest.

Python 3, 72 \$\cdots\$ 55 48 bytes

Saved 7 bytes thanks to the man himself Arnauld!!!

f=lambda l:len(l)and 1/len(l)>=l.pop()and 1+f(l) 

Try it online!

Assumes the input is sorted from highest to lowest.

Python 3, 72 \$\cdots\$ 48 46 bytes

Saved 7 bytes thanks to the man himself Arnauld!!!

f=lambda l:l>[]and 1/len(l)>=l.pop()and 1+f(l) 

Try it online!

Assumes the input is sorted from highest to lowest.

added 72 characters in body
Source Link
Noodle9
  • 20.4k
  • 3
  • 23
  • 47
Loading
deleted 7 characters in body
Source Link
Noodle9
  • 20.4k
  • 3
  • 23
  • 47
Loading
added 114 characters in body
Source Link
Noodle9
  • 20.4k
  • 3
  • 23
  • 47
Loading
Source Link
Noodle9
  • 20.4k
  • 3
  • 23
  • 47
Loading