Search for a command to run...
Alice is given a string containing multiple sentences separated by commas (,). No other symbols are used as separators.
Her task is to:
Split the string into individual sentences using commas.
Count the number of characters in each sentence, including spaces.
Return the maximum length among all the sentences.
Input
This is the first sentence,This is the second,Short one
Output
26
Sentence 1: "This is the first sentence" → Length = 26
Sentence 2: "This is the second" → Length = 18
Sentence 3: "Short one" → Length = 9
The longest sentence is the first one with 26 characters.
Example 1
This is the first sentence,This is the second,Short one26Example 2
Hello world,Coding is fun,AI is the future17This is the first sentence,This is the second,Short one
26