about | help | code help+videos | done | prefs |
apcsaListJustCharacters
Given a String input str with length > 0, return an ArrayList of all the characters in the String, as single-character Strings in the order they were encountered in the original. The output must have no repeats, meaning that if a character occurs more than once in the input it will only occur once in the output, based on the first time it appears in the input. HINTYou will need a loop for this. Also remember to declare and instantiate (and return) a new ArrayList. Also, the List interface has a handy method called contains() which can save you from having to use a nested loop. Neat! apcsaListJustCharacters("hi") → ["h", "i"] apcsaListJustCharacters("Hello") → ["H", "e", "l", "o"] apcsaListJustCharacters("a man a plan a canal panama") → ["a", " ", "m", "n", "p", "l", "c"] ...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: 240
Copyright Nick Parlante 2017 - privacy