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

 

zbaharav@kehillah.org 30-nestedloops > repeatMe
prev  |  next  |  chance

Given a String and and an integer n, return a string with the first letter appearing n times, the second repeating n-1 times, and so on, but make sure each character appears at least once. (Credit to Abby)


repeatMe("dog", 4) → "ddddooogg"
repeatMe("Tower", 3) → "TTToower"
repeatMe("Yay", 6) → "YYYYYYaaaaayyyy"

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

public String repeatMe(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: 100

Copyright Nick Parlante 2017 - privacy