Respuesta :
Answer:
See explaination for the program code
Explanation:
code:
public static int[] countLastDigits(int[] list) {
int[] count = new int[10];
for (int i = 0; i < list.length; i++) {
int digit = list[i] % 10;
count[digit]++;
}
return count;
}
The program which counts the number of elements with ends with a certain digit is given below with, elements ending with 0 as index, 1 and so on.
public static int[] countLastDigits(int[] list) {
#initializes a function named countLastDigits
int[] count = new int[10];
for (int i = 0; i < list.length; i++) {
#a for loop to iterate over the array created
int digit = list[i] % 10;
count[digit]++;
#appends to counts variable
}
return count;
}
Learn more : https://brainly.com/question/18478903