Drawing Book

  • + 0 comments

    Javascript

    function pageCount(n: number, p: number): number {
        const totalFlips = Math.floor(n/2);
        const myP = Math.floor(p/2);
        return Math.min(myP, totalFlips - myP);
    }