classical dp problem, max sum subsequence, lookup wiki, remember