about | help | code help+videos | done | prefs |
Given an ArrayList of Strings, return a new List of Strings where each element contains the first character of the same-index input String. Precondition: every element of lst will have length > 0.HINTYou will need a loop for this. Also remember to declare and instantiate (and return) a new ArrayList. apcsaListFirstCharacters(["Hello", "world"]) → ["H", "w"] apcsaListFirstCharacters(["I", "am", "legend"]) → ["I", "a", "l"] apcsaListFirstCharacters(["Crunchy chewy", "Awesome", "Nice and sweet", "Delightful and delicious", "Yummy treat"]) → ["C", "A", "N", "D", "Y"] ...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: 220
Copyright Nick Parlante 2017 - privacy