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

 

Map-2 > word0
prev  |  next  |  chance

Given an array of strings, return a Map<String, Integer> containing a key for every different string in the array, always with the value 0. For example the string "hello" makes the pair "hello":0. We'll do more complicated counting later, but for this problem the value is simply 0.

word0(["a", "b", "a", "b"]) → {"b": 0, "a": 0}
word0(["a", "b", "a", "c", "b"]) → {"b": 0, "c": 0, "a": 0}
word0(["c", "b", "a"]) → {"b": 0, "c": 0, "a": 0}

...Save, Compile, Run

public Map<String, Integer> word0(String[] strings) { }


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: 303 Post-solution available

Copyright Nick Parlante 2016 - privacy