TCS Interview Question

Count the words in a string