Pregunta de entrevista de ByteDance

Algorithm design related to some specific questions