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

 

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

Write a method that returns the longest string in an array of strings. If there are ties for longest string, return the last of the strings of that length. For this program, you have a restricted subset of string methods you may use. You may use any combination of: .equals .substring .charAt .length but you may not use any other string methods.


olympicLongString([]) → ""
olympicLongString(["this", "is", "a", "test", "of", "you"]) → "test"
olympicLongString(["a", "ab", "abc", "abcd", "abcde"]) → "abcde"

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

public String olympicLongString(String[] str) { }

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

Copyright Nick Parlante 2017 - privacy