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.
- Ice Cream Parlor
- Discussions
Ice Cream Parlor
Ice Cream Parlor
Sort by
recency
|
69 Discussions
|
Please Login in order to post a comment
A more elegant O(n) solution, similar to cb_kalz's solution (Scala):
O(n) solution (Scala):
1) Simply hash each price differential to its index. 2) find the first price which fulfills the addend. Example in Java 17: