Agilysys interview question

Oops with string manipulation, behavioural