-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmisc.cs
48 lines (37 loc) · 968 Bytes
/
misc.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
using System.Collections.Generic;
namespace cerberus
{
public class misc
{
public static Dictionary<int, int> MergeDictionariesWithSum(Dictionary<int, int> dict1, Dictionary<int, int> dict2)
{
var mergedDict = new Dictionary<int, int>();
foreach (var kvp in dict1)
{
mergedDict[kvp.Key] = kvp.Value;
}
foreach (var kvp in dict2)
{
if (mergedDict.ContainsKey(kvp.Key))
{
mergedDict[kvp.Key] += kvp.Value;
}
else
{
mergedDict[kvp.Key] = kvp.Value;
}
}
return mergedDict;
}
}
public interface IError
{
string get_message();
string get_html();
}
public interface IWarning
{
string get_message();
string get_html();
}
}