434 Number of Segments in a String
Count the number of segments in a string, where a segment is defined to be a contiguous sequence of non-space characters.
Please note that the string does not contain anynon-printablecharacters.
Example:
Time Complexity: O(n) time and space
Not a great problem, in my opinion
Last updated