#K58387. Longest Substring Without Asterisk

    ID: 30631 Type: Default 1000ms 256MiB

Longest Substring Without Asterisk

Longest Substring Without Asterisk

Given a string s, determine the length of the longest substring that does not contain the character *. In other words, if we define a substring sub of s such that it contains no * characters, then you need to compute

$$ \max_{sub \subseteq s} \{|sub|\} $$

subject to the condition that the substring does not contain *.

This problem tests your ability to process strings and handle simple conditional logic. Ensure your solution reads from standard input and writes to standard output.

inputFormat

The first line of input contains a single integer T ($1 \le T \le 10^5$), representing the number of test cases. Each of the next T lines contains a non-empty string s composed of lowercase letters and the character *.

outputFormat

For each test case, output a single integer representing the length of the longest substring that does not contain the character *. Each answer should be printed on a new line.

## sample
2
abc*defg*h
hello*world
4

5

</p>