Kloudrac interview question

Coding questions based upon the string