about | help | code help+videos | done | prefs |
Write a method that accepts an array of integers with each element an integer between 0 and 9 inclusive. Return an array with the index indicating the integer, and the value in the return array indicating how many times that integer occured. For example, if an array is passed in containing 5 3's and 2 9's in any order, the array to return would be {0, 0, 5, 0, 0, 0, 0, 0, 2}. Look at the test data for further examples. bbvdNumCountAdvanced1([5, 6, 5]) → [0, 0, 0, 0, 0, 2, 1, 0, 0, 0] bbvdNumCountAdvanced1([7, 7, 6, 6, 5, 5, 4, 4, 5, 5]) → [0, 0, 0, 0, 2, 4, 2, 2, 0, 0] bbvdNumCountAdvanced1([8, 8, 4, 2, 8]) → [0, 0, 1, 0, 1, 0, 0, 0, 3, 0] ...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