about | help | code help+videos | done | prefs |
Write a method that returns the number of times 'target' occurs in 'str'. Overlapping is allowed. This method should be case-sensitive, so if the case does not match it does not count as a match. The 'target' string will NOT be longer than 'str'. If 'target' is an empty string return 0 since you cannot match something that does not have any characters in it. dec18_2015_APSLHL_countOccurances("", "") → 0 dec18_2015_APSLHL_countOccurances("you cannot find it here", "") → 0 dec18_2015_APSLHL_countOccurances("Here is some test data. Happy testing.", "test") → 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: 280
Copyright Nick Parlante 2017 - privacy