Search in sources :

Example 6 with IntPair

use of com.shekhargulati.IntPair in project 99-problems by shekhargulati.

the class Problem4_2Test method shouldFindPairThatMaximizeWithinUnsortedArray.

@Test
public void shouldFindPairThatMaximizeWithinUnsortedArray() throws Exception {
    int[] numbers = { 6, 13, 19, 3, 8 };
    IntPair p = Problem4_2.maximize_unsorted(numbers);
    assertThat(p, equalTo(new IntPair(3, 19)));
}
Also used : IntPair(com.shekhargulati.IntPair) Test(org.junit.Test)

Aggregations

IntPair (com.shekhargulati.IntPair)6 Test (org.junit.Test)4 OptionalInt (java.util.OptionalInt)1