Orange Interview Question

one problem in strings topic