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

 

String-2 > repeatEnd
prev  |  next  |  chance

Given a string and an int n, return a string made of n repetitions of the last n characters of the string. You may assume that n is between 0 and the length of the string, inclusive.


repeatEnd("Hello", 3) → "llollollo"
repeatEnd("Hello", 2) → "lolo"
repeatEnd("Hello", 1) → "o"

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

public String repeatEnd(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: 230.0

Copyright Nick Parlante 2017 - privacy