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

 

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

Given two Sets of Integers, return a HashSet only containing the elements they DO NOT have in common. Your first two lines of code must be the following:

Set<Integer> set1 = new HashSet<Integer>(a);
Set<Integer> set2 = new HashSet<Integer>(b);

welcomeback_set_notInCommon([1, 2], [2, 3]) → [1, 3]
welcomeback_set_notInCommon([1, 2, 3, 4, 5], [1, 3, 5]) → [2, 4]
welcomeback_set_notInCommon([1, 2, 3], [2, 3, 4]) → [1, 4]

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

public Set<Integer> welcomeback_set_notInCommon(List<Integer> a, List<Integer> b) { }

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