Cisco interview question

1 very easy string manipulation + 2 medium questions from leetcode