mirror of
https://github.com/lWolvesl/leetcode.git
synced 2026-01-13 02:38:37 +08:00
7 lines
118 B
Python
7 lines
118 B
Python
import math
|
|
|
|
def least_minutes(n: int) -> int:
|
|
if n == 0:
|
|
return 0
|
|
return math.ceil(math.log2(n)) + 1
|