7 kyu
Populate hash with array keys and default value
1,256 of 4,131jhoffner
Description:
Complete the function so that it takes a collection of keys and a default value and returns a hash (Ruby) / dictionary (Python) / map (Scala) with all keys set to the default value.
Example
populate_dict(["draft", "completed"], 0) # should return {"draft": 0, "completed: 0}
Arrays
Fundamentals
Similar Kata:
Stats:
Created | Jun 20, 2013 |
Published | Jun 20, 2013 |
Warriors Trained | 5722 |
Total Skips | 770 |
Total Code Submissions | 13702 |
Total Times Completed | 4131 |
Ruby Completions | 2734 |
Python Completions | 1256 |
Scala Completions | 8 |
Total Stars | 48 |
% of votes with a positive feedback rating | 90% of 346 |
Total "Very Satisfied" Votes | 287 |
Total "Somewhat Satisfied" Votes | 47 |
Total "Not Satisfied" Votes | 12 |