Random Point testcase 32/35 fault
I cannot understand why the testcase 32 fails.\nAll points inside rectangles. Whats wrong ?\n\n\nclass Solution {\n    int[][] rects;\n\n    public Solution(int
I cannot understand why the testcase 32 fails.\nAll points inside rectangles. Whats wrong ?\n\n```\nclass Solution {\n    int[][] rects;\n\n    public Solution(int[][] rects) {\n        this.rects = rects;\n    }\n\n    public int[] pick() {\n        int [] res = new int[2];\n        Random random = new Random();\n\n        int maxWidth  = 0;\n        for (int i = 0 ; i < rects.length; i++) {\n            maxWidth = maxWidth + Math.abs(rects[i][2] - rects[i][0]);\n        }\n\n        int x = random.nextInt(maxWidth);\n\n        int rectWidth = 0;\n        int rectNum = 0;\n        for (int i = 0 ; i < rects.length; i++) {\n            rectWidth = Math.abs(rects[i][2] - rects[i][0]);\n            x = x - rectWidth;\n            if (x <= 0) {\n                res[0] = rects[i][2] - Math.abs(x);\n                rectNum = i;\n                break;\n            }\n        }\n\n        int y = 0;\n        int rectHeight = Math.abs(rects[rectNum][3] - rects[rectNum][1]);\n        if ( rectHeight > 0 ) y = random.nextInt(Math.abs(rects[rectNum][3] - rects[rectNum][1]));\n\n        res[1] = rects[rectNum][1] + y;\n\n        return res;\n    }\n}\n```
['Java']