Pergunta de entrevista da empresa Yahoo

Check if the string is balanced. eg {{}} should return true, Given a input sentence tokenize it and print the word count. eg the boy went to the school- > the 2, boy 1, went 1, to 1, school 1