Foobar Error: Error compiling the code, please try again later

Viewed 1567

I am getting an error in this program for finding the missing elements in two arrays, I'm new to Java.

package com.google.challenges; 
public class Answer {
    public static int answer(int[] x, int[] y) { 
        for (int n : x)  {
            if (!isPresent(n, y)) {
                return n;
            }
        }
        for (int n : y) {
            if (!isPresent(n, x)) {
                return n;
            }
        }
         return 0;
     }
     private static boolean isPresent(int n, int[] b){
        for (int i : b) {
            if (n == i) {
                return true;
            }
        }
        return false;
    }
}
1 Answers
Related