Goldman Sachs interview question

Two coding questions on the Hackerrank platform involving strings and arrays.