1419. Minimum Number of Frogs Croaking
https://leetcode.com/problems/minimum-number-of-frogs-croaking
Description
Given the string croakOfFrogs
, which represents a combination of the string "croak" from different frogs, that is, multiple frogs can croak at the same time, so multiple “croak” are mixed. Return the minimum number of different frogs to finish all the croak in the given string.
A valid "croak" means a frog is printing 5 letters ‘c’, ’r’, ’o’, ’a’, ’k’ sequentially. The frogs have to print all five letters to finish a croak. If the given string is not a combination of valid "croak" return -1.
Example 1:
Example 2:
Example 3:
Example 4:
Constraints:
1 <= croakOfFrogs.length <= 10^5
All characters in the string are:
'c'
,'r'
,'o'
,'a'
or'k'
.
ac
Previous1418. Display Table of Food Orders in a RestaurantNext1420. Build Array Where You Can Find The Maximum Exactly K Comparisons
Last updated