• + 0 comments

    help,my c# solution only has 19/23 test failed .Does it has anything to do with using List?

    public static int anotherMinimaxProblem(List a) { int max = int.MaxValue; for (int i = 0; i < a.Count; i++) {

        int maxima = 0;
        for (int j = 0; j < a.Count; j++)
        {
            if (i == j)
            {
                continue;
            }
            int answer = a[i] ^ a[j];
            if (answer > maxima)
            {
                maxima = answer;
            }
        }
        if (maxima < max)
        {
            max = maxima;
        }
    }
    return max;
    

    }