about | help | code help+videos | done | prefs |
APCS String 2, Problem 3. Given a string and an int n, return a string made of the first n characters of the string, followed by the first n-1 characters of the string, and so on. You may assume that n is between 0 and the length of the string, inclusive (i.e. n >= 0 and n <= str.length()). S23_repeatFront("Chocolate", 4) → "ChocChoChC" S23_repeatFront("Chocolate", 3) → "ChoChC" S23_repeatFront("Ice Cream", 2) → "IcI" ...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: 200
Copyright Nick Parlante 2017 - privacy