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
|
2006 Discussions
|
Please Login in order to post a comment
(js) (totalPages, destination) => Math.min( Math.ceil((destination - 1) / 2), Math.floor( (totalPages - destination) / 2 ) + ((!(totalPages % 2) && destination % 2) ? 1 : 0) );
Python
Go Solution
GoLang