Implement this method in Java:
public static int[] countNums(int n) {
int x = n;
int[] nums = new int[10];
while(x != 0) {
nums[x % 10]++;
x /= 10;
}
return nums;
}
That will return an array of the counts of the digits from 0 to 9.
Up to 999999, one short of a million.
The biggest 4 digit number that can be made from using the digits of 850236, using a digit at most once, is 8653.
the answer is = first 2-digit number by using 48= 28,82 and in 3 digit is=282,228,822,822
Using a calculator will make it easier
the highest number you can count up to using 10 bits is 1029 using binary
1324
1111
Six of them.
There are twelve possible solutions using the rule you stated.
9,999,876 is the greatest seven-digit number using four different digits.
The smallest four-digit number not using zero is 1000. In a four-digit number, the first digit cannot be zero, so the smallest possible value for the first digit is 1. The remaining three digits can be any number from 0-9, so the smallest possible four-digit number is 1000.
the place of each digit help the value of the number by using your multuplication