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.
- Prepare
- Algorithms
- Implementation
- Drawing Book
- Discussions
Drawing Book
Drawing Book
Sort by
recency
|
2094 Discussions
|
Please Login in order to post a comment
C# return p <= n / 2 ? p / 2 : (n/2 -p/2);
C++ one liner:
int pageCount(int n, int p) { return std::min(p/2, ((n/2)-(p/2))); }
My humble python solution:
Typescript Solution: