Ad
  • Custom User Avatar

    Test cases for Java does not detect slow solutions. :/

    Furthermore - there are accepted java solutions which produces wrong answers for some cases.

    Please add following test case:

    import org.junit.Assert;
    import org.junit.Test;
    
    import java.util.ArrayList;
    import java.util.List;
    
    public class RectanglesUnionTest {
        @Test
        public void testHugeOverlap() {
            List<int[]> rectangles = new ArrayList<>();
    
            for (int i = 0; i < 10000; i++) {
                rectangles.add(new int[]{i, i, 1000 + i, 1000 + i});
            }
    
            Assert.assertEquals(20988001, RectanglesUnion.calculateSpace(rectangles.toArray(new int[][]{})));
        }
    
    }
    
  • Custom User Avatar
  • Custom User Avatar
  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Description of Kata should be somehow polished. ;)

  • Custom User Avatar

    It could be passed without using splice.

    Negative test case isn't present. Code, which uses filter method passes.