Pergunta de entrevista da empresa Amazon

Coding question related to RegEx expression