about | help | code help+videos | done | prefs |
Write a method that accepts an array of integers. Each integer will be either a 0, 1, 2, 3, 4, 5, 6, 7, 8, or 9. The array lists the grade of climbs on the "v-scale" in the order a climber climbed on a particular day. Return a string that lists the v-scales the climber did, in numerical order of scale, followed by the number of climbs they did at that level. Look at the test data for examples. You are NOT allowed to use a whole bunch of different variables to solve this problem! Think about how you could use arrays. NOTES: There will always be at least one climb listed in 'vGrades'. There is no comma or space at the end of the string that gets returned. test2022_04_21_APSLHL_climbingGrades([6, 4, 3, 4, 4, 5, 3, 4, 5, 1]) → "v1:1, v3:2, v4:4, v5:2, v6:1" test2022_04_21_APSLHL_climbingGrades([1, 0, 0, 0, 0, 1, 0, 1, 0, 2, 0, 0, 2]) → "v0:8, v1:3, v2:2" test2022_04_21_APSLHL_climbingGrades([5, 4, 3, 1, 0, 0, 0, 1, 0]) → "v0:4, v1:2, v3:1, v4:1, v5: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: 250
Copyright Nick Parlante 2017 - privacy