about | help | code help+videos | done | prefs |
Without using arrays or strings, write a method that returns the number of occurrences of a particular set of digits within a positive integer. For example, the set of digits 73 occurs 2 times in the number 731773. Two parameters will be passed in. As preconditions, you may assume that 'num' will be positive and 'target' will be a positive integer with fewer digits than 'num'. Return the number of time 'target' occurs in 'num'. Note that LEADING zeros are NOT allowed. abc2countMatch(40401, 40) → 2 abc2countMatch(128142, 12) → 1 abc2countMatch(94200, 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