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

 

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

Write a RECURSIVE method that determines if it is possible to construct a string of a given length 'targetLength' by concatenating selected strings from an array of strings. If it is possible, return 'true' otherwise return 'false'. Your solution MUST be recursive, although you MAY also use a loop as long as you are not using it to SOLVE the actual problem. I highly recommend using a helper method!


apr_9_2019_HL_recursiveStringLength(["this is a long string", "not as long as this one though", "some strings are longer than others and this one is really long"], 21) → true
apr_9_2019_HL_recursiveStringLength([], 5) → false
apr_9_2019_HL_recursiveStringLength([], 0) → true

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

public boolean apr_9_2019_HL_recursiveStringLength(String[] strs, int targetLength) { }

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

Copyright Nick Parlante 2017 - privacy