hatiger
BAN USER
Comments (3)
Reputation 0
Page:
1
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
0
of 0 vote
public static int KthMaxSortedMartix(int k, int n, int[,] dataArray)
{
int res = 1;
int[] maxIndexex = new int[k];
for (int i = 0; i < k; ++i)
{
maxIndexex[i] = n  1;
}
for (int i = 0; i < k; ++i)
{
int max = int.MinValue;
int maxIndex = 0;
for (int j = 0; j < k; ++j)
{
if(dataArray[nj1, maxIndexex[j]] > max)
{
maxIndex = j;
max = dataArray[nj1, maxIndexex[j]];
}
}
maxIndexex[maxIndex];
res = max;
}
return res;
}

hatiger
July 28, 2014 Comment hidden because of low score. Click to expand.
0
of 0 vote
A shot in the dark :)
A={x1, x2, x3, .. xn}
B={y1, y2, y3, .. yn}
Sum(A) = x1+x2+x3+...+xn (for all x)
Mul(A) = x1*x2*x3*...*xn (for all x!=0)
Sum(B) = y1+y2+y3+...+yn (for all y)
Mul(B) = y1*y2*y3*...*yn (for all y!=0)
if(Sum(A) == Sum(B) && Mul(A) == Mul(B)
&& zerosCountIn(A) == zerosCountIn(B))
{
return true;
}
else
{
return false;
}
Page:
1
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
 hatiger July 28, 2014