Question: The method longestStreak is intended to determine the longest substring of consecutive identical characters in the parameter str and print the result. For example, the

The method longestStreak is intended to determine
The method longestStreak is intended to determine the longest substring of consecutive identical characters in the parameter str and print the result. For example, the call longestStreak("CCAAAAATTT!") should print the result "A 5" because the longest substring of consecutive identical characters is "AAAAA". Complete the method below. Your implementation should conform to the example above. public static void longestStreak(String str) { int maxCount = 0; String longestSubString = str.charAt(0); for(int i=0; i

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!