Two lc medium level questions, one minimum path problem using BFS, one data structrue design problem. Same questions as https://leetcode.com/discuss/interview-question/873993/imc-trading-new-grad-fast-track-interview-questions-from-hackerrank except for two small modifications:
sum() that returns the sum of all values in the stack. Also needs to be in O(1) time.