[Solved] How do I count the maximum number of two characters in a array?
[ad_1] If you want to find the maximum sub array length which contains only continious r and b, here is a solution. The basic idea is using two cursor and greedy search. public static int findMaximum(char[] input) { int result = 0; int first = 0; int second = 0; while (input[first] == input[second]) { … Read more