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
|
2078 Discussions
|
Please Login in order to post a comment
Here is problem solution in Python, Java, C++, C and Javascript - https://programmingoneonone.com/hackerrank-drawing-book-problem-solution.html
python solution: I imagined a fictive page at the start (page 0), and, if the n was even, I also imagined a fictive page at the end (increased the value of n).
Here is my c++ solution, you can watch the explanation here : https://youtu.be/1T650YeAwRI
Constant time solution C++
}
* Constant time solution C++