Warner Bros. Discovery interview question

Leecode easy question revolving around String and Arrays.