/**
 * 
 */
package mathsquared.resultswizard2;

import java.lang.reflect.Array;
import java.util.Arrays;

/**
 * @author MathSquared
 * 
 */
public class ArrayUtils {
    /**
     * Creates a deep copy of a multi-dimensional array, copying all sub-arrays of the array (but not the elements themselves).
     * 
     * @param toCopy the multi-dimensional array to copy
     * @return a copy of the array
     */
    // HASHTAG UNCHECKED CASTS
    @SuppressWarnings("unchecked")
    public static <T> T[][] deepCopyOf (T[][] toCopy) {
        // Instantiate a generic array
        Class<T[]> type = (Class<T[]>) toCopy.getClass().getComponentType();
        T[][] copied = (T[][]) Array.newInstance(type, toCopy.length);

        // If a two-dimensional array, use Arrays.copyOf; otherwise, recurse
        if (!(toCopy instanceof Object[][][])) { // not 3-D; by parameter, must be 2-D
            for (int i = 0; i < toCopy.length; i++) {
                copied[i] = Arrays.copyOf(toCopy[i], toCopy[i].length);
            }
        } else { // 3-D or above
            for (int i = 0; i < toCopy.length; i++) {
                copied[i] = (T[]) deepCopyOf((Object[][]) toCopy[i]);
            }
        }

        return copied;
    }
}

@@ -1229,11 +1229,1350 @@
 d;%0A    %7D
+%0A%0A    public static boolean checkTies (String%5B%5D%5B%5D results) %7B%0A        /*%0A         * Implementation:%0A         * %0A         * The algorithm keeps track of the amount of results that have been seen so far, where a %22result%22 is one String.%0A         * %0A         * For each sub-array of the input array, the algorithm adds subArr.length - 1 to an internal tracking variable.%0A         * %0A         * If this variable is non-zero, it means that there was a tie previously, and the next few places should be skipped with null.%0A         * %0A         * If this variable is zero, it means that there have been no ties--or all were accounted for--so the next array should have elements.%0A         */%0A%0A        int num = 0; // tracking variable mentioned above%0A        for (String%5B%5D x : results) %7B%0A            // num never decreases by more than 1 each turn, and can never decrease if it is 0, so check for num %3C 0 is unnecessary%0A            assert (num %3E= 0);%0A            if (num == 0 && (results == null %7C%7C results.length == 0)) %7B%0A                return false;%0A            %7D%0A            if (num %3E 0 && results != null && results.length != 0) %7B%0A                return false;%0A            %7D%0A            num += (x == null) ? -1 : x.length - 1;%0A        %7D%0A%0A        // no problems; num does not need to be 0 in case of ties for last place%0A        return true;%0A    %7D
 %0A%7D%0A

Add checkTies method