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

 

orion.a.smith@gmail.com apcsa-lists > apcsaListIncreasingStrings
prev  |  next  |  chance

Given a String with at least 1 character, return an ArrayList of Strings made from successive characters of the String, such that each element of the ArrayList has one more character than its index value. In other words the first element at index 0 of the returned ArrayList contains just one character of the input, the next element has the next two characters, the next element has the next three characters and so on. Process only until you do not have enough remaining characters to build the next String - this means that in many cases the returned String values will not contain all characters from the input.


apcsaListIncreasingStrings("abc") → ["a", "bc"]
apcsaListIncreasingStrings("abcd") → ["a", "bc"]
apcsaListIncreasingStrings("abcde") → ["a", "bc"]

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

public List<String> apcsaListIncreasingStrings(String str) { }

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: 240

Copyright Nick Parlante 2017 - privacy