Pregunta de entrevista de ByteDance

It's just the leetcode live coding challenge