Implement stacks, streaming median, and upward path sum | TikTok Interview Question