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

 

orion.a.smith@gmail.com apcsa-arrays > apcsaArraysFindLongest
prev  |  next  |  chance

Given an array of String values, find and return the String value with the longest length in the array. Precondition: arr has at least one element.


HINT: Strings use length(), arrays use length.  There are reasons.

apcsaArraysFindLongest(["1", "12", "123", "1234", "22"]) → "1234"
apcsaArraysFindLongest(["dog", "cat", "elephant", "lion"]) → "elephant"
apcsaArraysFindLongest(["apple", "banana", "cherry"]) → "banana"

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

public String apcsaArraysFindLongest(String[] arr) { }

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

Copyright Nick Parlante 2017 - privacy