give string s return number segment stringa segment define contiguous sequence nonspace character example 1input s Hello JohnOutput 5explanation the segment Hello JohnExample 2input s HelloOutput 1 constraints0 slength 300s consist lowercase uppercase English letter digit follow character _ the space character s