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

 

firstName


Given a list of names return the index of the one that comes first alphabetically.
Note: The first letter of each name will be capitalized but this will not affect the results. Note: If two names are the same return the one with the lowest index.


firstName(["Aaron", "Ken", "Gena", "Jason", "Brandy"]) → 0
firstName(["Rich", "David", "Nolan", "Gunnar", "Sam"]) → 1
firstName(["Michelle", "Kim", "Karen", "Lena", "Mary", "Nora"]) → 2

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

public int firstName(String[] names) { }

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

Copyright Nick Parlante 2017 - privacy