Find majority element in a sequence, greedy algorithm for scheduling
jobs, finding longest palindromic subsequence in a string.