i have two arrays
input1 = new string[4] { "A", " B", " C", " D" };
and
input2 = new int[6] { 2, 3, 1, 5, 4, 3 };
now i want like this
{A,B}=2,{A,C}=3,{A,D}=1<br />
{B,C}=5,{B,D}=4,{C,D}=3
public static void minimum_cost(out string[] input1, out int[] input2)
{
input1 = new string[4] { "A", " B", " C", " D" };
input2 = new int[6] { 2, 3, 1, 5, 4, 3 };
int i = 0;
int j = 0;
var query = from s in input1
let num = i++
group s by num / 2 into g
select g.ToArray();
var results = query.ToArray();
var query2 = from s1 in input2
let num1 = j++
group s1 by num1 / 1 into g1
select g1.ToArray();
var results2 = query.ToArray();
foreach (string[] r1 in results)
{
Console.WriteLine("{0}",r1);
}
foreach (string[] r2 in results2)
{
Console.WriteLine("{0}", r2);
}
}
i was try this i didn't get it