Пример на C #:
Dictionary<string,object>[] items = {
new Dictionary<string, object> {{ "name", "Bank BRI"}, {"amount", 0 }},
new Dictionary<string, object> {{ "name", "Bank BRI"}, {"amount", 0 }},
new Dictionary<string, object> {{ "name", "Bank BCA"}, {"amount", 1412341234 }},
new Dictionary<string, object> {{ "name", "Bank CIMB Niaga"}, {"amount", 532532552 }}
};
var amounts = new Dictionary<string, int>();
foreach (var item in items) {
string bank = (string)item["name"];
int amount = (int)item["amount"];
if (amounts.ContainsKey(bank)) {
amounts[bank] += amount;
} else {
amounts.Add(bank, amount);
}
}
foreach (var amount in amounts) {
Console.WriteLine("{0}: {1}", amount.Key, amount.Value);
}