REXA interview question

Standard coding question - Char manipulation