> max.subseq(c(-1, -2, 3, 5, 6, -2, -1, 4, -4, 2, -1)) [1] 3 5 6 -2 -1 4