https://medium.com/@stevenbrunoqst/leetcode-algorithm-dynamic-programming-11-type5-subsequence-30c9125e1838