https://medium.com/@stevenbrunoqst/leetcode-algorithm-dynamic-programming-10-type5-subsequence-5d7ac88ff683