Pregunta de entrevista de Capital One

Typical medium level algorithmic leetcode type problems.