@Test public void test2() { Solution_2 sol = new KthSmallestElementinaSortedMatrix().new Solution_2(); int[][] matrix = { {1, 5, 9}, {10, 11, 13}, {12, 13, 15} }; assertEquals(1, sol.kthSmallest(matrix, 1)); assertEquals(9, sol.kthSmallest(matrix, 3)); assertEquals(11, sol.kthSmallest(matrix, 5)); assertEquals(12, sol.kthSmallest(matrix, 6)); assertEquals(13, sol.kthSmallest(matrix, 7)); assertEquals(13, sol.kthSmallest(matrix, 8)); assertEquals(15, sol.kthSmallest(matrix, 9)); }
@Test public void test2() { Solution_2 sol = new IntegerBreak().new Solution_2(); assertEquals(1, sol.integerBreak(2)); assertEquals(2, sol.integerBreak(3)); assertEquals(4, sol.integerBreak(4)); assertEquals(6, sol.integerBreak(5)); assertEquals(9, sol.integerBreak(6)); assertEquals(12, sol.integerBreak(7)); assertEquals(18, sol.integerBreak(8)); assertEquals(27, sol.integerBreak(9)); assertEquals(36, sol.integerBreak(10)); }