about | help | code help+videos | done | prefs |
Write a method that returns the number of occurances of the number "1" in an array of integers. Only count the number 1, NOT the number of times the digit 1 occurs. For example, do NOT count 11 or 131 since they are not the number 1. We are only looking for the number 1, not the digit 1. bbvdCountOnes([]) → 0 bbvdCountOnes([1, 2, 1, 4, 0]) → 2 bbvdCountOnes([0, 3, 3, 4, 5, 2]) → 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: 280
Copyright Nick Parlante 2017 - privacy