Cerillion interview question

Problems on string and array. Basi DSA.