Pregunta de entrevista de Meta

Gave two leetcode problems easy/medium