You are viewing a single comment's thread. Return to all comments →
public class Solution {
public static void main(String[] args) { Scanner scan = new Scanner(System.in); String s = scan.nextLine(); scan.close(); if (s.trim().isEmpty()) { System.out.println(0); } else{ String[] splitString = (s.replaceAll("^\\W+", "").split("[\\s!,?._'@]+")); System.out.println(splitString.length); for (String string : splitString) { System.out.println(string); } } }
}
Seems like cookies are disabled on this browser, please enable them to open this website
Left Rotation
You are viewing a single comment's thread. Return to all comments →
public class Solution {
}