about | help | code help+videos | done | prefs |
Write a method countLeadingZeros which is passed an array of integers and which returns a count of the number of leading zeros in the array. For example if the array {0,0,0,5,3,9,0,2} was passed to the method, the value of 3 would be returned. If an empty array is passed to the method, it should return 0. countLeadingZeros([0, 0, 0, 5, 3, 0, 9]) → 3 countLeadingZeros([1, 2, 3, 4]) → 0 countLeadingZeros([0, 0, 8, 2, 4, 1, 0, 0, 0, 66, 9]) → 2 ...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: 200
Copyright Nick Parlante 2017 - privacy