We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
# Write your code here
#left to right
min_left = p // 2
#right to left
n = n + 1 if n % 2 == 0 else n
min_right = (n - p) // 2
return min_left if min_left <= min_right else min_right
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Drawing Book
You are viewing a single comment's thread. Return to all comments →
My humble python solution: