ByteDance interview question

leetcode 88 and an easy one