// Path: src/main/java/org/jsuffixarrays/Tools.java
// static final void assertAlways(boolean condition, String msg)
// {
//     if (!condition)
//     {
//         throw new AssertionError(msg);
//     }
// }


import static org.jsuffixarrays.Tools.assertAlways;

        7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
        7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
        7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
        7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
    };

    /* fields */
    private final int ALPHABET_SIZE;
    private final int BUCKET_A_SIZE;
    private final int BUCKET_B_SIZE;
    private int [] SA;
    private int [] T;
    private int start;

    /**
     * {@inheritDoc}
     * <p>
     * Additional constraints enforced by DivSufSort algorithm:
     * <ul>
     * <li>non-negative (&ge;0) symbols in the input</li>
     * <li>symbols limited by alphabet size passed in the constructor.</li>
     * <li>length >= 2</li>
     * </ul>
     * <p>
     */
    @Override
    public final int [] buildSuffixArray(int [] input, int start, int length)
    {
        assertAlways(input != null, "input must not be null");
        assertAlways(length >= 2, "input length must be >= 2");

// Path: src/main/java/org/jsuffixarrays/Tools.java
// static final void assertAlways(boolean condition, String msg)
// {
//     if (!condition)
//     {
//         throw new AssertionError(msg);
//     }
// }


// Path: src/main/java/org/jsuffixarrays/DivSufSort.java
import static org.jsuffixarrays.Tools.assertAlways;

        7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
        7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
        7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
        7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
    };

    /* fields */
    private final int ALPHABET_SIZE;
    private final int BUCKET_A_SIZE;
    private final int BUCKET_B_SIZE;
    private int [] SA;
    private int [] T;
    private int start;

    /**
     * {@inheritDoc}
     * <p>
     * Additional constraints enforced by DivSufSort algorithm:
     * <ul>
     * <li>non-negative (&ge;0) symbols in the input</li>
     * <li>symbols limited by alphabet size passed in the constructor.</li>
     * <li>length >= 2</li>
     * </ul>
     * <p>
     */
    @Override
    public final int [] buildSuffixArray(int [] input, int start, int length)
    {
        assertAlways(input != null, "input must not be null");
        assertAlways(length >= 2, "input length must be >= 2");

        MinMax mm = Tools.minmax(input, start, length);
