id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

jebbert@volusia.k12.fl.us > test2024_03_12_P1SLHL_freqDigits
prev  |  next  |  chance

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)

public int[] test2024_03_12_P1SLHL_freqDigits(int[] nums) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 290

Copyright Nick Parlante 2017 - privacy