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
- Data Structures
- Advanced
- Cube Summation
- Discussions
Cube Summation
Cube Summation
Sort by
recency
|
84 Discussions
|
Please Login in order to post a comment
I have complaints... the starting code for C++ deceived me into thinking that the sums could be stored in an "int". I should have realized this might not work given the information in the description. Fortunately, unlocking an example told me quickly enough that "int" wasn't gonna cut it.
Also it seems like you can solve this without what seems to have been the intended solution.
O((log n)^3) per query/update
Trie structure is a good solution for this problem.
Great post