Some algorithms to solve problems on leetcode