@@ -0,0 +1,327 @@
+public class Solution %7B%0A%0A    public static int countSegments(String s) %7B%0A%0A        int spaceCount = 0;%0A%0A        s += %22 %22;%0A%0A        for (int i = 1; i %3C s.length(); i++) %7B%0A%0A            if (s.charAt(i) == ' ' && s.charAt(i - 1) != ' ') %7B%0A                spaceCount++;%0A            %7D%0A%0A        %7D%0A%0A        return spaceCount;%0A%0A    %7D%0A%0A%7D%0A

Create : 434 Number of Segments in a String