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

 

orion.a.smith@gmail.com apcsa-encryption > apcsaFindFirstCodeword
prev  |  next  |  chance

Given a String and an ArrayList of code words, find and return the code word that appears first in the input. If no code words appear in the input, return an empty String. The input may be a combination of different characters including uppercase and lowercase, but all code words will be lowercase.


apcsaFindFirstCodeword("Help help I'm being repressed", ["being", "repressed", "help"]) → "help"
apcsaFindFirstCodeword("Help help I'm being repressed", ["for", "sooth"]) → ""
apcsaFindFirstCodeword("Blah hello", ["hello", "blah"]) → "blah"

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

public String apcsaFindFirstCodeword(String str, ArrayList<String> codes) { }

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