Garmin interview question

String manipulation problem (Leetcode easy)