Pergunta de entrevista da empresa Cognizant

Coding question on regular expression[situation based]