2139. Minimum Moves to Reach Target Score
Содержание
class Solution:
def minMoves(self, target: int, maxDoubles: int) -> int:
res = 0
while maxDoubles and target > 1:
res += 1
if target % 2 == 1:
target -= 1
else:
maxDoubles -= 1
target >>= 1
res += target - 1
return res