Verisk interview question

Array and string problem solving