about | help | code help+videos | done | prefs |
Write a method that returns an array indicating the frequency of occurrence of each digit, 0 through 9 in each position in all the numbers in the 'nums' array. In the resulting array, the value at index 'n' will be the number of times the digit 'n' appears anywhere in any digit in any number in 'nums'. All numbers in 'nums' will be positive. You may use one or more helper methods. Remember to make sure each method has only one return statement. Look at the test data for examples. test2024_03_12_P1SLHL_freqDigits([2, 82888]) → [0, 0, 2, 0, 0, 0, 0, 0, 4, 0] test2024_03_12_P1SLHL_freqDigits([1, 2, 3, 4, 5, 6, 7, 8, 9]) → [0, 1, 1, 1, 1, 1, 1, 1, 1, 1] test2024_03_12_P1SLHL_freqDigits([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]) → [1, 4, 1, 1, 1, 1, 1, 1, 1, 1] ...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: 290
Copyright Nick Parlante 2017 - privacy