Qualification round - problem one : Beautiful String