Pergunta de entrevista da empresa ByteDance

A medium leetcode DP question (leetcode 198)