FPEvalDataset/LeetCodeProblem
0304
1{2 "id": 3689,3 "name": "maximum_area_rectangle_with_point_constraints_ii",4 "difficulty": "Hard",5 "link": "https://leetcode.com/problems/maximum-area-rectangle-with-point-constraints-ii/",6 "date": "2024-12-01 00:00:00",7 "task_description": "There are n points on an infinite plane. You are given two integer arrays `xCoord` and `yCoord` where `(xCoord[i], yCoord[i])` represents the coordinates of the `ith` point. Your task is to find the **maximum **area of a rectangle that: Can be formed using **four** of these points as its corners. Does **not** contain any other point inside or on its border. Has its edges **parallel** to the axes. Return the **maximum area** that you can obtain or -1 if no such rectangle is possible. **Example 1:** **Input:** xCoord = [1,1,3,3], yCoord = [1,3,1,3] **Output:** 4 **Explanation:** **** We can make a rectangle with these 4 points as corners and there is no other point that lies inside or on the border. Hence, the maximum possible area would be 4. **Example 2:** **Input:** xCoord = [1,1,3,3,2], yCoord = [1,3,1,3,2] **Output:** -1 **Explanation:** **** There is only one rectangle possible is with points `[1,1], [1,3], [3,1]` and `[3,3]` but `[2,2]` will always lie inside it. Hence, returning -1. **Example 3:** **Input:** xCoord = [1,1,3,3,1,3], yCoord = [1,3,1,3,2,2] **Output:** 2 **Explanation:** **** The maximum area rectangle is formed by the points `[1,3], [1,2], [3,2], [3,3]`, which has an area of 2. Additionally, the points `[1,1], [1,2], [3,1], [3,2]` also form a valid rectangle with the same area. **Constraints:** `1 <= xCoord.length == yCoord.length <= 2 * 105` `0 <= xCoord[i], yCoord[i] <= 8 * 107` All the given points are **unique**.",8 "public_test_cases": [9 {10 "label": "Example 1",11 "input": "xCoord = [1,1,3,3], yCoord = [1,3,1,3]",12 "output": "4 "13 },14 {15 "label": "Example 2",16 "input": "xCoord = [1,1,3,3,2], yCoord = [1,3,1,3,2]",17 "output": "-1 "18 },19 {20 "label": "Example 3",21 "input": "xCoord = [1,1,3,3,1,3], yCoord = [1,3,1,3,2,2]",22 "output": "2 "23 }24 ],25 "private_test_cases": [26 {27 "input": [28 [29 2775251,30 15465771,31 60248552,32 69068054,33 32307832,34 7289130,35 67773578,36 1124002,37 11417286,38 6704738,39 1380807,40 30883793,41 20945649,42 63312606,43 18304738,44 65470199,45 55088899,46 73863090,47 77583553,48 4863358249 ],50 [51 40521121,52 1057342,53 20051701,54 30111767,55 18586971,56 60680139,57 22003205,58 44664399,59 20391669,60 75651066,61 63102693,62 79751859,63 18798845,64 58278059,65 58841902,66 6691528,67 531455,68 62613577,69 60875989,70 2850272471 ]72 ],73 "output": -174 },75 {76 "input": [77 [78 66855275,79 6962965,80 28634554,81 59810953,82 50174999,83 42177349,84 4346751185 ],86 [87 61597978,88 46030985,89 13770457,90 58796632,91 55931557,92 20634821,93 7494363394 ]95 ],96 "output": -197 },98 {99 "input": [100 [101 64253447,102 15053746,103 19526565,104 67831574,105 51589979,106 1860955,107 32910477,108 40867020,109 66120655,110 70054786,111 31620358,112 7293109,113 52066018,114 58015992,115 1833864,116 12805908,117 46615227118 ],119 [120 32476072,121 20370323,122 67086099,123 15060351,124 31988721,125 74520276,126 46892114,127 61753766,128 57172834,129 413078,130 23426343,131 10477631,132 14881860,133 8413999,134 58663421,135 78183694,136 55172445137 ]138 ],139 "output": -1140 },141 {142 "input": [143 [144 2769856,145 75818483,146 60495239,147 52271952,148 63104275,149 33513444,150 6785827,151 8698135,152 68962930,153 9418269,154 22271347,155 53639861,156 61415095,157 78259445,158 8069568,159 63831048,160 14798944,161 72354537,162 5481814,163 64856913164 ],165 [166 75261275,167 51789647,168 64948925,169 34231638,170 74260490,171 40389897,172 18397434,173 56577341,174 60494367,175 27658509,176 28552918,177 6719631,178 23466735,179 21740725,180 1658710,181 73396429,182 7101200,183 44729905,184 42935521,185 45272530186 ]187 ],188 "output": -1189 },190 {191 "input": [192 [193 57540235,194 25624178,195 37650923,196 22689188,197 34866098198 ],199 [200 11699477,201 29964064,202 20796260,203 27595145,204 17369442205 ]206 ],207 "output": -1208 },209 {210 "input": [211 [212 67709643,213 33227524,214 8400082,215 25517272,216 45209563,217 8382362,218 59702895,219 1439596,220 45481743,221 76457924,222 20003754,223 10775140,224 35316104,225 56312025,226 43969792,227 16568428,228 54481026229 ],230 [231 32345727,232 35370525,233 74631338,234 8336085,235 40460069,236 77067617,237 50206426,238 78434814,239 45479448,240 78884383,241 39432878,242 20884003,243 70295330,244 30627688,245 7844266,246 44804534,247 69949212248 ]249 ],250 "output": -1251 },252 {253 "input": [254 [255 3217501,256 9228867,257 779878,258 51453884,259 77962327,260 46387231,261 41661806,262 67152638,263 54678293,264 61414039265 ],266 [267 66294494,268 56034905,269 3660104,270 53454188,271 60436385,272 38774804,273 43968974,274 79585007,275 46126661,276 28578865277 ]278 ],279 "output": -1280 },281 {282 "input": [283 [284 38014061,285 41298651,286 56292287,287 765897,288 112508,289 70947775290 ],291 [292 74725954,293 16609219,294 8649059,295 5471288,296 16023054,297 59381748298 ]299 ],300 "output": -1301 },302 {303 "input": [304 [305 72285809,306 66493609,307 37445465,308 65099696,309 55315733,310 35631867,311 74830170,312 63550575,313 36507954314 ],315 [316 69427131,317 2426842,318 22680401,319 24500184,320 43444331,321 27951053,322 45988813,323 46664674,324 73743477325 ]326 ],327 "output": -1328 },329 {330 "input": [331 [332 74366639,333 71182844,334 76885797,335 32415964,336 13327512,337 40094436,338 26342512,339 57732981,340 37349482341 ],342 [343 37390960,344 67341138,345 52533890,346 53366100,347 42662995,348 49214596,349 31565623,350 36988983,351 56581855352 ]353 ],354 "output": -1355 }356 ],357 "haskell_template": "maxRectangleArea :: [Int] -> [Int] -> Int\nmaxRectangleArea xCoord yCoord ",358 "ocaml_template": "let maxRectangleArea (xCoord: int list) (yCoord: int list) : int = ",359 "scala_template": "def maxRectangleArea(xCoord: List[Int],yCoord: List[Int]): Int = { \n \n}",360 "java_template": "class Solution {\n public long maxRectangleArea(int[] xCoord, int[] yCoord) {\n \n }\n}",361 "python_template": "class Solution(object):\n def maxRectangleArea(self, xCoord, yCoord):\n \"\"\"\n :type xCoord: List[int]\n :type yCoord: List[int]\n :rtype: int\n \"\"\"\n "362}