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

 

tmhscs@gmail.com welcomeback > welcomeback_queue_copyCapitalWords
prev  |  next  |  chance

Given a Queue of Strings, copy all of the names that start with a capital letter to a new Queue and return that one. Your first line of code must be:

Queue<String> queue = new LinkedList<String>(a);
Your last line of code can be:
return new ArrayList<String>(answer);

welcomeback_queue_copyCapitalWords(["Sue", "bob", "Joe", "amy"]) → ["Sue", "Joe"]
welcomeback_queue_copyCapitalWords(["Sue", "Bob", "Joe", "amy"]) → ["Sue", "Bob", "Joe"]
welcomeback_queue_copyCapitalWords(["sue", "bob", "joe", "amy"]) → []

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

public List<String> welcomeback_queue_copyCapitalWords(List<String> a) { }

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

Post-solution available

Copyright Nick Parlante 2017 - privacy