about | help | code help+videos | done | prefs |
Write a method that returns the least number of digits actually found in an array of positive integers. In other words, if you were to count up all of the 0's, 1's, 2's, 3's etc. in all of the numbers in the array, then find which number actually occurs, but occurs the LEAST frequently, then return the number of times that number occurs. For example, if the digit 7 occurs the only 2 times and the digit 5 does not occur at all, but all other digits occur more often, return 2. You don't return zero for the 5, because the digit has to occur at least once to count. It doesn't matter if there is a tie because you are not returning the digit that occurs the least... you are only returning how many times it occurs. Note that all numbers in the array will be positive. The array can have any number of numbers in it, including being empty. airplaneMinDigits([5453, 3435, 5333, 44444, 53555, 53344, 44445, 554433]) → 11 airplaneMinDigits([5453, 3435, 5333, 444044, 53555, 53344, 44445, 554433]) → 1 airplaneMinDigits([52453, 34235, 53233, 44444, 53555, 53344, 4425, 554433]) → 4 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 330
Copyright Nick Parlante 2017 - privacy