Upside interview question

The Coderpad part: string related problems