Goldman Sachs Interview Question

Hackerrank Medium level questions - Regular expression