Pregunta de entrevista de ByteDance

It’s your typical leetcode question.