Can someone help explain to me what each line of code does?
public static int[] countLetters(char[] chars) {int[] counts = new int[26];
for (int i = 0; i < chars.length;="">counts[chars[i] - 'a']++;
return counts;}
public static void displayCounts(int[] counts) {for (int i = 0; i < counts.length;="" i++)="">if ((i + 1) % 10 == 0)System.out.println(counts[i] + " " + (char)(i + 'a'));elseSystem.out.print(counts[i] + " " + (char)(i + 'a') + " ");}}}
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here