plduhoux
2/20/2018 - 9:42 PM

avoidObstacles

int avoidObstacles(int[] inputArray) {
    //find min i as if i tuples are not in inputArray
    int i = 1;
    boolean found = false;
    while (!found) {
        i++;
        found = true;
        for (int k = 0; k < inputArray.length; k++) {
            if (inputArray[k] % i == 0) {found = false;break;}
        }
    }
    return i;
}