algotithm problems (mainly from leetcode)