My approach to solve Leetcode by Python