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

 

jebbert@volusia.k12.fl.us > test2024_11_21_APP1SLHL_stringFromStrings
prev  |  next  |  chance

Write a method that returns a string made up from characters in an array of strings. Characters are selected from the array of strings such that the first character of the first string is followed by the second character of the second string, and so on such that the nth character is always taken from the nth string. As a precondition, you may assume that each string in the array will have enough characters so there will be an nth character in the nth string. For example, if the array of strings contains {"abcde","xy","123456","*$%!"} you would return "ay3!". Look at the test data for additional examples.


test2024_11_21_APP1SLHL_stringFromStrings(["lkasdfjljkahdfoiewa", "agadfka", "faseasf", "ewfa", "htreeeet", "geaerheoieafe", "Aklasdsdhlkhweoiewa", "ASDFHOWEEWFEFEAFSD", "AISODFHYOIGHEDSAGA", "JKJHKDSASDHdsjkaasdhfasdf", "aoifdhoierhargerrg", "gaadfhoireyhoiogierargagrpoiafdagadf"]) → "lgsaehsEODhh"
test2024_11_21_APP1SLHL_stringFromStrings(["adfkjsl", "WEaewg", "rghrd", "ahreargdiaadsf", "ajgosdiaeoihglkladfk", "sfhkjhlksshoiew", "akljadghkdjaahuid", "oiopusafd", "zvhjkbzjkd", "adfihjkbzxdujfdhuie"]) → "aEheshgfkx"
test2024_11_21_APP1SLHL_stringFromStrings(["you", "you", "add", "bloat"]) → "yoda"

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

public String test2024_11_21_APP1SLHL_stringFromStrings(String[] strs) { }

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

Copyright Nick Parlante 2017 - privacy