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

 

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

Write a RECURSIVE method that accepts a string 'str' and another string 'insert'. Your goal is to return a string with all the characters from 'str' but backwards and with the contents of 'insert' inserted between each letter. Look at the test data for examples. For this problem you can use any or all of the .length, .substring, .charAt String methods but no other String methods. You may NOT use arrays, ArrayList, List, or any other similar structure. Your soluiton MUST be recursive!


may12_2017_APSLHL_backwardsInsert("you", "<->") → "u<->o<->y"
may12_2017_APSLHL_backwardsInsert("abcdefghijklmn", "-") → "n-m-l-k-j-i-h-g-f-e-d-c-b-a"
may12_2017_APSLHL_backwardsInsert("run for the hills", "X") → "sXlXlXiXhX XeXhXtX XrXoXfX XnXuXr"

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

public String may12_2017_APSLHL_backwardsInsert(String str, String insrt) { }

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

Copyright Nick Parlante 2017 - privacy