implementation of leetcode in both python and cpp