reTXT interview question

Asked to do the betterprogrammer.com test