forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice


Recursion-1 > strCopies
prev  |  next  |  chance

Given a string and a non-empty substring sub, compute recursively if at least n copies of sub appear in the string somewhere, possibly with overlapping. N will be non-negative.

strCopies("catcowcat", "cat", 2) → true
strCopies("catcowcat", "cow", 2) → false
strCopies("catcowcat", "cow", 1) → true

...Save, Compile, Run (ctrl-enter)

public boolean strCopies(String str, String sub, int n) { }

Editor font size %:
Shorter output

Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 387.0 Post-solution available

Copyright Nick Parlante 2017 - privacy