You are given a string croakOfFrogs representing a combination of sounds made by different frogs simultaneously croaking the word "croak". Multiple frogs can croak at the same time, resulting in their letters being interleaved.
A valid croak consists of the characters 'c', 'r', 'o', 'a', and 'k' produced in that exact sequential order. A single frog may croak multiple times, but it must complete all five characters of one croak before starting another.
Return the minimum number of distinct frogs required to produce the given string croakOfFrogs. If the string is not a valid sequence of croaks, return
Constraints:
croakOfFrogs.length
croakOfFrogs consists only of the characters 'c', 'r', 'o', 'a', and 'k'.
You are given a string croakOfFrogs representing a combination of sounds made by different frogs simultaneously croaking the word "croak". Multiple frogs can croak at the same time, resulting in their letters being interleaved.
A valid croak consists of the characters 'c', 'r', 'o', 'a', and 'k' produced in that exact sequential order. A single frog may croak multiple times, but it must complete all five characters of one croak before starting another.
Return the minimum number of distinct frogs required to produce the given string croakOfFrogs. If the string is not a valid sequence of croaks, return
Constraints:
croakOfFrogs.length
croakOfFrogs consists only of the characters 'c', 'r', 'o', 'a', and 'k'.