about | help | code help+videos | done | prefs |
countOccurrences
Given two Strings, str1 and str2, return the number of times str2 is contained within str1. countOccurrences("1 1 2 2 3 3 2 2 1 1", "1") → 4 countOccurrences("one two three four", "o") → 3 countOccurrences("one two three four", "three") → 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: 200 Post-solution available
Copyright Nick Parlante 2017 - privacy