logo Practice-It logo

removeOddCount

Language/Type: Java Guava Multiset collections
Author: Marty Stepp (on 2013/01/22)

Write a method named removeOddCount that accepts a List of strings as a parameter and removes any element value that occurs an odd number of total times from the list. For example, in the list [a, b, a, c, a, d, d, b, b, b, e, e, b], the strings "a", "b", and "c" occur an odd number of times (3, 5, 1 times respectively), so your method should change the list to [d, d, e, e]. Use one Guava Multiset as auxiliary storage.

Type your solution here:


This is a method problem. Write a Java method as described. Do not write a complete program or class; just the method(s) above.

You must log in before you can solve this problem.


Log In

If you do not understand how to solve a problem or why your solution doesn't work, please contact your TA or instructor.
If something seems wrong with the site (errors, slow performance, incorrect problems/tests, etc.), please

Is there a problem? Contact a site administrator.