about | help | code help+videos | done | prefs |
You may NOT use any strings or string methods for this problem. Write a method that returns the number of times a particular digit appears in a non-negative integer. Paramber 'num' will be the non-negative integer. Parameter 'digit' will be the digit to count. As a precondition, num>=0 and 0<=digit<=9. smaugCountMatchingDigitsAdvanced2(531124, 1) → 2 smaugCountMatchingDigitsAdvanced2(265498121, 1) → 2 smaugCountMatchingDigitsAdvanced2(24982, 4) → 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: 290
Copyright Nick Parlante 2017 - privacy