Number of Segments in a String
Given a string s, return the number of segments in the string. A segment is defined to be a contiguous sequence of non-space characters.
LeetCode Problem - 434
class Solution {
public int countSegments(String s) {
// Remove leading and tr...
perfinsights.hashnode.dev1 min read