I dnt know how to solve this problem
Given a string which contains a number as input, the objective is to create an array arr, such that arr[i] represents the number of times the digit i appeared in the string. Note that the maximum value of i in arr[i] will be 9 as the digits are 0,1,2,3,4,5,6,7,8,9.
Do you know how to allocate arrays?
Do you know how to write a for loop?
Do you know how to get a character from a certain position in a string?
Here is what you need to know:
EITHER string.charAt(index) OR string.substring(start index, end index)
Where size = the numbers of elements in the array, which would be 10 for you (0,1,2,3,4,5,6,7,8,9)
int arr = new int[size];
You could also use string.indexOf and keep checking until you get -1
Read up on those