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

 

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

Write a method that returns a string made up of the first character from the first string in array 'strs', then the second character from the second string, the third character from the third string, etc. Except don't use the character 'avoid'. Also, the nth string might not have n or more characters, so you will need to make sure the nth character exists before you try to add it. Look at the test data for examples. You MAY use recursion to solve this, but recursion is NOT required.


feb26_2016_APSLHL_makeStr([], "a") → ""
feb26_2016_APSLHL_makeStr(["abcd", "efgh", "ijkl", "mnop"], "f") → "akp"
feb26_2016_APSLHL_makeStr(["abcd", "efgh", "ijkl", "mnop"], "x") → "afkp"

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

public String feb26_2016_APSLHL_makeStr(String[] strs, char avoid) { }

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

Copyright Nick Parlante 2017 - privacy