Hidoc Dr interview question

Oops concept ,string related program