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.
- Equal Stacks
- Discussions
Equal Stacks
Equal Stacks
Sort by
recency
|
90 Discussions
|
Please Login in order to post a comment
I use a map for elements index and sums and increment index on the list with the lowest sum each loop
time O(n) space O(1)
Here is the approch for Time complexity O(n) and space complexity O(1).
Here is - HackerRank Equal Stacks problem solution in Python, Java, C++, C and javascript
In JAVA8 :
Typescript solution with a map. Can work with any count of incoming arrays