TikTok interview question

Implement stacks, streaming median, and upward path sum