var temp = new Dictionary();for (var i = 0; i < list[0].Count; i++){ if (temp.ContainsKey(list[0][i])) { list[1][temp[list[0][i]]] += "+" + list[1][i]; list[0].RemoveAt(i); list[1].RemoveAt(i); i--; } else { temp.Add(list[0][i], i); }}