Number Of Segments In A String Leetcode