Atlassian interview question

Leetcode questions. array string manip