LeetCode algorithms.