Sort by

recency

|

2038 Discussions

|

  • + 0 comments

    def pageCount(n, p): return p//2 if p//2 <= n //4 else n//2 - p//2

  • + 0 comments

    def pageCount(n, p): if(n%2==0 and p==n-1 and p!=1): return 1 if((p//2)+1>(n-p)//2): return (n-p)//2 else: return p//2

  • + 0 comments

    In C++ Solution

    int pageCount(int n, int p) { cin>>n>>p;

    return min(p/2,n/2-p/2);
    

    }

  • + 0 comments

    If you're looking to spark creativity and explore your artistic side, this drawing book is a perfect companion! It's filled with space for all your doodles, sketches, and more. And while you're at it, why not take a ride with Excellence in Reliable Bus Travel Services offered by the Coventry Coach Company? They make every trip smooth and stress-free, so you can focus on your artwork wherever you go!

  • + 0 comments

    Here is my c++ solution, you can watch the explanation here : https://youtu.be/1T650YeAwRI

    int pageCount(int n, int p) {
        return min(p/2, n/2-p/2);
    }