6 kyu
Dictionary Merge
248 of 1,233Kartoffelsalat
Description:
Your task is to implement a function that takes one or more dictionaries and combines them in one result dictionary.
The keys in the given dictionaries can overlap. In that case you should combine all source values in an array. Duplicate values should be preserved.
Here is an example:
var source1 = new Dictionary<string, int>{{"A", 1}, {"B", 2}};
var source2 = new Dictionary<string, int>{{"A", 3}};
Dictionary<string, int[]> result = DictionaryMerger.Merge(source1, source2);
// result should have this content: {{"A", [1, 3]}, {"B", [2]}}
You can assume that only valid dictionaries are passed to your function. The number of given dictionaries might be large. So take care about performance.
Fundamentals
Similar Kata:
Stats:
Created | May 1, 2018 |
Published | May 1, 2018 |
Warriors Trained | 2379 |
Total Skips | 114 |
Total Code Submissions | 4110 |
Total Times Completed | 1233 |
C# Completions | 248 |
Python Completions | 873 |
Swift Completions | 124 |
Total Stars | 43 |
% of votes with a positive feedback rating | 94% of 216 |
Total "Very Satisfied" Votes | 192 |
Total "Somewhat Satisfied" Votes | 20 |
Total "Not Satisfied" Votes | 4 |
Total Rank Assessments | 3 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 6 kyu |
Lowest Assessed Rank | 7 kyu |