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
|
2091 Discussions
|
Please Login in order to post a comment
Typescript Solution:
rust in O(1) solution
My C# solution; public static int pageCount(int n, int p) { var books = Enumerable.Range(0, n + 1).Chunk(2); int counter = 0; List counters = [];
Python solution
def pageCount(n, p): # Write your code here if n == 0: return 0 pages = [i for i in range(0, n + 1)] book = [pages[i:i + 2] for i in range(0, len(pages), 2)] book[-1].insert(1, 0) counter = 0 counters = []