about | help | code help+videos | done | prefs |
count
Write a recursive method 'count' that returns the number of Strings 'toFind' in the String str. If str is the empty string (""), it should return 0. No loops of any kind allowed! The string to search for 'toFind' will have at least 1 character. Both strings will be all lower case. count("cat dog cat!", "t") → 2 count("hello there", "ss") → 0 count("brother from another mother", "th") → 3 ...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: 350 Post-solution available
Copyright Nick Parlante 2017 - privacy