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

 

bono@usc.edu recursionLab > longestString
prev  |  next  |  chance

Returns the length of the longest string in an array of strings. Hint: use a helper method to do recursion on an array and call it from longestString. The parameters for the new method will be the current index along with the array itself.


longestString(["here", "are", "some", "words"]) → 5
longestString(["hello"]) → 5
longestString([]) → 0

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

public int longestString(String[] words) { }

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

Copyright Nick Parlante 2017 - privacy