Orange interview question

one problem in strings topic