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

 

konstans@stuy.edu > findOverlap
prev  |  next  |  chance

Find all values that are in both word lists. Any words that occur in both lists will be added to an empty list which you will return at the end. Do not add the same word to the answer list more than once. The order of the words will be the same order that they occur in listA.


findOverlap(["d", "a", "b", "c"], ["x", "y", "z"]) → []
findOverlap(["a", "a", "a", "a", "b", "a", "c", "b"], ["a", "a", "a", "a", "b", "a", "c", "b"]) → ["a", "b", "c"]
findOverlap(["okonomiyaki", "uni", "uni", "taro", "taro"], ["ebi", "ebi", "okonomiyaki", "uni", "uni", "taro", "okonomiyaki"]) → ["okonomiyaki", "uni", "taro"]

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

public List<String> findOverlap(List<String> wordsA, List<String> wordsB){ }

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

Copyright Nick Parlante 2017 - privacy