Problem Given a string, find number of words in that string. For this problem a word is defined by a string of one or more english alphabets. Input Format A string not more than 400000 characters long. The string can be defined by following regular expression: [A-Za-z !,?.\_'@]+ That means the string will only contain english alphabets, blank spaces and this characters: "!,?._'@". Output Format In the first line, print number of words nn in the string. The words don't need to be unique. In the next nn lines, print all the words you found in the order they appeared in the input. Sample Input He is a very very good boy, isn't he? Sample Output 10 He is a very very good boy isn t he Solution import java.io.* ; import java.util.* ; public class Solution { ...
Comments
Post a Comment