Problem Statement | |||||||||||||
The longest consecutive rating increase streak is a very important statistic in any competition. You are to calculate this statistic for a certain player. You will be given a int[] ratingChanges containing the rating changes of the player in chronological order. Your method should return the maximum number of consecutive competitions with positive rating changes. Note that 0 is not a positive number. | |||||||||||||
Definition | |||||||||||||
| |||||||||||||
Constraints | |||||||||||||
| - | ratingChanges will contain between 1 and 50 elements, inclusive. | ||||||||||||
| - | Each element of ratingChanges will be between -1000 and 1000, inclusive. | ||||||||||||
Examples | |||||||||||||
| 0) | |||||||||||||
| |||||||||||||
| 1) | |||||||||||||
| |||||||||||||
| 2) | |||||||||||||
| |||||||||||||
| 3) | |||||||||||||
| |||||||||||||
| 4) | |||||||||||||
| |||||||||||||