System Design Problem Leetcode Python