about | help | code help+videos | done | prefs |
Write a method that returns the total number of times the string 'find' appears in the string 'orig'. Note that sometimes the matches can overlap. For example, "wowowow" has 3 occurances of "wow" if you allow for overlap (which we are). smaugCountRepeats("This is a test isn't it?", "is") → 3 smaugCountRepeats("wowowow", "wow") → 3 smaugCountRepeats("wowowowowowowow", "wow") → 7 ...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 Post-solution available
Copyright Nick Parlante 2017 - privacy