Pregunta de entrevista de Merge API

Medium Leetcode-y question. Not on leetcode