@@ -0,0 +1,454 @@
+/**%0A *Count the number of segments in a string, where a segment is defined to be a contiguous sequence of non-space characters.%0A *%0A *Please note that the string does not contain any non-printable characters.%0A *%0A *Example:%0A *%0A *Input: %22Hello, my name is John%22%0A *Output: 5%0A */%0Aclass Solution %7B%0A    public int countSegments(String s) %7B%0A        s = s.trim();%0A        if (s == null %7C%7C s.length() == 0) return 0;%0A        return s.split(%22%5C%5Cs+%22).length;%0A    %7D%0A%7D%0A

Create NumberOfSegmentsInAString.java