Algorithms implemented for the leetcode online judge.