LeetCode python and java solutions