LeetCode problem solved code