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

 

norm.krumpe@muohio.edu > repeatN
prev  |  next  |  chance

Given a string str and a non-negative integer n, return a new string consisting of n copies of str.


repeatN("cat", 2) → "catcat"
repeatN("house", 3) → "househousehouse"
repeatN("boat", 1) → "boat"

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

String repeatN(String str, 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: 200

Copyright Nick Parlante 2017 - privacy