solutions to algorithm problems on leetcode.com