You are viewing a single comment's thread. Return to all comments →
Python code:
def pageCount(n, p): # Write your code here ld = n - p #difference from last fd = p - 1 #difference from first if (ld) <= (fd): if n % 2 != 0: return ld // 2 else: if ld % 2 != 0: return (ld + 1) // 2 return ld // 2 else: if fd % 2 != 0: return (fd + 1) // 2 return fd // 2
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 →
Python code: