codes for all LeetCode question