• + 0 comments

    I was overthinking this problem at first, but once I broke it down it made sense—it’s really just about finding the minimum turns from either side of the book. My Python version looks like this:

    def pageCount(n, p): return min(p // 2, (n // 2) - (p // 2))

    Clean and efficient—sometimes the simplest logic is the most powerful! this delta key helps alot