ByteDance interview question

LeetCode