Given a string s, return the total number of segments present in the string.
A segment is defined as a contiguous sequence of characters that are not spaces.
Constraints:
s.length
s consists of lowercase and uppercase English letters, digits, or one of the following characters: "!@#$%^&*()_+-=',.:".
The only space character in s is ' '.
Given a string s, return the total number of segments present in the string.
A segment is defined as a contiguous sequence of characters that are not spaces.
Constraints:
s.length
s consists of lowercase and uppercase English letters, digits, or one of the following characters: "!@#$%^&*()_+-=',.:".
The only space character in s is ' '.