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

 

Map-1 > mapAB2
prev  |  next  |  chance

Modify and return the given map as follows: if the keys "a" and "b" are both in the map and have equal values, remove them both.


mapAB2({"a": "aaa", "b": "aaa", "c": "cake"}) → {"c": "cake"}
mapAB2({"a": "aaa", "b": "bbb"}) → {"a": "aaa", "b": "bbb"}
mapAB2({"a": "aaa", "b": "bbb", "c": "aaa"}) → {"a": "aaa", "b": "bbb", "c": "aaa"}

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

public Map<String, String> mapAB2(Map<String, String> map) { }

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

Copyright Nick Parlante 2017 - privacy