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

 

frew@mclean.com map-3 > mostUniqueActors
prev  |  next  |  chance

Return the movie with the most unique actors. You may only use 1 for loop to determine the unique actors and 1 for loop to determine the movie.


mostUniqueActors(["KevinBacon", "JackNicholson", "DemiMoore", "TomCruise", "KevinBacon", "DemiMoore", "JonBonJovi", "AnnabellaSciorra", "AnnabellaSciorra", "MandyMoore", "StarkSands", "JeremyPiven"], ["AFewGoodMen", "AFewGoodMen", "AFewGoodMen", "AFewGoodMen", "DestinationAnywhere", "DestinationAnywhere", "DestinationAnywhere", "DestinationAnywhere", "ChasingLiberty", "ChasingLiberty", "ChasingLiberty", "ChasingLiberty"]) → "ChasingLiberty"
mostUniqueActors(["KevinBacon", "JackNicholson", "DemiMoore", "TomCruise", "KevinBacon", "DemiMoore", "JonBonJovi", "AnnabellaSciorra", "NoName"], ["AFewGoodMen", "AFewGoodMen", "AFewGoodMen", "AFewGoodMen", "DestinationAnywhere", "DestinationAnywhere", "DestinationAnywhere", "DestinationAnywhere", "DestinationAnywhere"]) → "DestinationAnywhere"
mostUniqueActors(["KevinBacon", "JackNicholson", "DemiMoore", "TomCruise", "KevinBacon", "DemiMoore"], ["AFewGoodMen", "AFewGoodMen", "AFewGoodMen", "AFewGoodMen", "DestinationAnywhere", "DestinationAnywhere"]) → "AFewGoodMen"

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

public String mostUniqueActors(String[] s1, String[] s2) { }

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

Copyright Nick Parlante 2017 - privacy