Leetcode 399 Python Algorithm Data