Sudoku verifier in Java
Boolean duplicate = false;
    Set&lt;Integer&gt; set= new HashSet&lt;&gt;();
    for(int i : array){
        if(set.contains(i)){
            duplicate = true;
    } else {
        set.add(i);         
    }
    }
    return duplicate;



This can be written more briefly as 

    Set&lt;Integer&gt; seen = new HashSet&lt;&gt;();
    for (int i : array) {
        if (!seen.add(i)) {
            return true;
        }
    }

    return false;


You do not need to check contains before add.  The add will check contains for you.  

You do not need to keep going after you've found a duplicate.  You can stop immediately and return.  Everything else will be just wasted work.  

You do not need the duplicate variable.  You can just return instead.  

The indent is now consistent, and I added some horizontal whitespace for readability.  

Another alternative would be 

    int[] seenCounts = new int[array.length];
    for (int i : array) {
        i--;
        if (seenCounts[i] &gt;= 1) {
            return true;
        } else {
            seenCounts[i]++;
        }
    }

    return false;


The array will be more efficient than the Set.  

Also, this will enforce that the numbers are in the range 1 to 9.  If you had a 0 or 10, this code would throw an exception.  This is important because an array with five 9s and four 0s would return true;