You are viewing a single comment's thread. Return to all comments →
if(n >= 1 and n <= 10**5 and p >= 1 and p <= n): front_flips = p // 2 total_flips = n // 2 back_flips = total_flips - front_flips if(front_flips <= back_flips): return front_flips else: return back_flips
Drawing Book
You are viewing a single comment's thread. Return to all comments →