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

 

Map-1 > mapShare
prev  |  next  |  chance

Modify and return the given map as follows: if the key "a" has a value, set the key "b" to have that same value. In all cases remove the key "c", leaving the rest of the map unchanged.

mapShare({"b": "bbb", "c": "ccc", "a": "aaa"}) → {"b": "aaa", "a": "aaa"}
mapShare({"b": "xyz", "c": "ccc"}) → {"b": "xyz"}
mapShare({"d": "hi", "c": "meh", "a": "aaa"}) → {"d": "hi", "b": "aaa", "a": "aaa"}

...Save, Compile, Run

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


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

Copyright Nick Parlante 2016 - privacy