CoolFace
Datasetpublic

TheRealSamuel/LeetCodeProblem

sourceHugging Faceupdated 2mo agoView on Hugging Face
0likes564downloads
1{2    "id": 3251,3    "name": "maximum_area_of_longest_diagonal_rectangle",4    "difficulty": "Easy",5    "link": "https://leetcode.com/problems/maximum-area-of-longest-diagonal-rectangle/",6    "date": "2023-12-31 00:00:00",7    "task_description": "You are given a 2D **0-indexed **integer array `dimensions`. For all indices `i`, `0 <= i < dimensions.length`, `dimensions[i][0]` represents the length and `dimensions[i][1]` represents the width of the rectangle `i`. Return _the **area** of the rectangle having the **longest** diagonal. If there are multiple rectangles with the longest diagonal, return the area of the rectangle having the **maximum** area._ **Example 1:** ``` **Input:** dimensions = [[9,3],[8,6]] **Output:** 48 **Explanation:** For index = 0, length = 9 and width = 3. Diagonal length = sqrt(9 * 9 + 3 * 3) = sqrt(90) โ‰ˆ 9.487. For index = 1, length = 8 and width = 6. Diagonal length = sqrt(8 * 8 + 6 * 6) = sqrt(100) = 10. So, the rectangle at index 1 has a greater diagonal length therefore we return area = 8 * 6 = 48. ``` **Example 2:** ``` **Input:** dimensions = [[3,4],[4,3]] **Output:** 12 **Explanation:** Length of diagonal is the same for both which is 5, so maximum area = 12. ``` **Constraints:** `1 <= dimensions.length <= 100` `dimensions[i].length == 2` `1 <= dimensions[i][0], dimensions[i][1] <= 100`",8    "public_test_cases": [9        {10            "label": "Example 1",11            "input": "dimensions = [[9,3],[8,6]]",12            "output": "48 "13        },14        {15            "label": "Example 2",16            "input": "dimensions = [[3,4],[4,3]]",17            "output": "12 "18        }19    ],20    "private_test_cases": [21        {22            "input": [23                [24                    53,25                    9026                ],27                [28                    36,29                    9330                ],31                [32                    72,33                    9734                ],35                [36                    24,37                    8538                ],39                [40                    22,41                    2742                ],43                [44                    75,45                    4646                ],47                [48                    12,49                    3150                ],51                [52                    80,53                    3054                ],55                [56                    56,57                    558                ],59                [60                    9,61                    2462                ],63                [64                    38,65                    6266                ],67                [68                    74,69                    5770                ],71                [72                    59,73                    5574                ],75                [76                    44,77                    978                ],79                [80                    48,81                    9382                ],83                [84                    17,85                    7286                ],87                [88                    15,89                    190                ],91                [92                    56,93                    5894                ],95                [96                    94,97                    3898                ],99                [100                    22,101                    59102                ],103                [104                    28,105                    53106                ],107                [108                    13,109                    63110                ],111                [112                    63,113                    80114                ],115                [116                    46,117                    70118                ],119                [120                    67,121                    60122                ],123                [124                    58,125                    60126                ],127                [128                    69,129                    93130                ],131                [132                    31,133                    50134                ],135                [136                    62,137                    85138                ],139                [140                    30,141                    79142                ],143                [144                    29,145                    71146                ],147                [148                    47,149                    54150                ],151                [152                    30,153                    10154                ],155                [156                    79,157                    48158                ],159                [160                    6,161                    12162                ],163                [164                    59,165                    49166                ],167                [168                    13,169                    97170                ],171                [172                    26,173                    3174                ],175                [176                    15,177                    30178                ],179                [180                    15,181                    94182                ],183                [184                    11,185                    74186                ],187                [188                    10,189                    71190                ],191                [192                    2,193                    63194                ],195                [196                    89,197                    87198                ],199                [200                    1,201                    76202                ],203                [204                    23,205                    57206                ],207                [208                    43,209                    86210                ],211                [212                    17,213                    65214                ],215                [216                    47,217                    92218                ],219                [220                    24,221                    27222                ],223                [224                    71,225                    22226                ],227                [228                    55,229                    56230                ],231                [232                    64,233                    5234                ],235                [236                    60,237                    93238                ],239                [240                    4,241                    68242                ],243                [244                    35,245                    90246                ],247                [248                    92,249                    70250                ],251                [252                    42,253                    25254                ],255                [256                    97,257                    28258                ],259                [260                    28,261                    34262                ],263                [264                    60,265                    7266                ],267                [268                    85,269                    4270                ],271                [272                    49,273                    72274                ],275                [276                    34,277                    68278                ],279                [280                    2,281                    87282                ],283                [284                    2,285                    91286                ],287                [288                    4,289                    28290                ],291                [292                    7,293                    81294                ],295                [296                    93,297                    30298                ],299                [300                    94,301                    87302                ],303                [304                    23,305                    5306                ],307                [308                    35,309                    37310                ],311                [312                    16,313                    70314                ],315                [316                    8,317                    92318                ],319                [320                    67,321                    62322                ],323                [324                    99,325                    67326                ]327            ],328            "output": 8178329        },330        {331            "input": [332                [333                    29,334                    68335                ],336                [337                    26,338                    9339                ],340                [341                    97,342                    3343                ],344                [345                    87,346                    29347                ],348                [349                    37,350                    80351                ],352                [353                    40,354                    81355                ],356                [357                    97,358                    73359                ],360                [361                    18,362                    96363                ],364                [365                    4,366                    26367                ],368                [369                    100,370                    73371                ],372                [373                    37,374                    41375                ],376                [377                    68,378                    21379                ],380                [381                    8,382                    34383                ],384                [385                    16,386                    27387                ],388                [389                    21,390                    43391                ],392                [393                    60,394                    94395                ],396                [397                    51,398                    28399                ],400                [401                    63,402                    24403                ],404                [405                    98,406                    8407                ],408                [409                    65,410                    47411                ],412                [413                    71,414                    56415                ],416                [417                    2,418                    20419                ],420                [421                    21,422                    9423                ],424                [425                    72,426                    82427                ],428                [429                    50,430                    3431                ],432                [433                    11,434                    34435                ],436                [437                    12,438                    31439                ],440                [441                    56,442                    54443                ],444                [445                    83,446                    49447                ],448                [449                    1,450                    84451                ],452                [453                    45,454                    73455                ],456                [457                    76,458                    11459                ],460                [461                    20,462                    20463                ],464                [465                    38,466                    82467                ],468                [469                    24,470                    70471                ],472                [473                    17,474                    21475                ],476                [477                    82,478                    54479                ],480                [481                    3,482                    86483                ],484                [485                    38,486                    59487                ],488                [489                    62,490                    49491                ],492                [493                    49,494                    65495                ],496                [497                    16,498                    94499                ],500                [501                    89,502                    59503                ],504                [505                    88,506                    70507                ],508                [509                    60,510                    44511                ],512                [513                    18,514                    5515                ],516                [517                    11,518                    7519                ],520                [521                    58,522                    78523                ],524                [525                    86,526                    39527                ],528                [529                    89,530                    40531                ],532                [533                    67,534                    80535                ],536                [537                    35,538                    11539                ],540                [541                    30,542                    7543                ],544                [545                    43,546                    64547                ],548                [549                    52,550                    96551                ],552                [553                    96,554                    88555                ],556                [557                    21,558                    67559                ],560                [561                    38,562                    56563                ],564                [565                    85,566                    42567                ],568                [569                    46,570                    9571                ],572                [573                    52,574                    66575                ],576                [577                    19,578                    73579                ],580                [581                    45,582                    84583                ],584                [585                    74,586                    28587                ],588                [589                    77,590                    91591                ],592                [593                    28,594                    8595                ],596                [597                    48,598                    42599                ],600                [601                    27,602                    13603                ],604                [605                    1,606                    6607                ],608                [609                    14,610                    92611                ],612                [613                    38,614                    71615                ],616                [617                    7,618                    57619                ],620                [621                    98,622                    36623                ],624                [625                    96,626                    72627                ]628            ],629            "output": 8448630        },631        {632            "input": [633                [634                    99,635                    69636                ],637                [638                    91,639                    27640                ],641                [642                    7,643                    39644                ],645                [646                    3,647                    59648                ],649                [650                    18,651                    6652                ],653                [654                    72,655                    32656                ],657                [658                    17,659                    2660                ],661                [662                    91,663                    28664                ],665                [666                    86,667                    90668                ],669                [670                    21,671                    12672                ],673                [674                    7,675                    53676                ],677                [678                    35,679                    61680                ],681                [682                    31,683                    99684                ],685                [686                    11,687                    100688                ],689                [690                    71,691                    7692                ],693                [694                    93,695                    72696                ],697                [698                    73,699                    44700                ],701                [702                    39,703                    12704                ],705                [706                    76,707                    89708                ],709                [710                    56,711                    45712                ],713                [714                    52,715                    51716                ],717                [718                    4,719                    59720                ],721                [722                    30,723                    32724                ],725                [726                    50,727                    25728                ],729                [730                    55,731                    16732                ],733                [734                    21,735                    89736                ],737                [738                    39,739                    59740                ],741                [742                    96,743                    30744                ],745                [746                    37,747                    49748                ],749                [750                    33,751                    60752                ],753                [754                    97,755                    66756                ],757                [758                    61,759                    88760                ],761                [762                    45,763                    35764                ],765                [766                    22,767                    53768                ],769                [770                    34,771                    69772                ],773                [774                    24,775                    78776                ],777                [778                    15,779                    58780                ],781                [782                    41,783                    72784                ],785                [786                    18,787                    25788                ],789                [790                    64,791                    100792                ],793                [794                    99,795                    47796                ],797                [798                    2,799                    90800                ],801                [802                    86,803                    71804                ],805                [806                    14,807                    16808                ],809                [810                    3,811                    52812                ],813                [814                    87,815                    82816                ],817                [818                    46,819                    39820                ],821                [822                    89,823                    4824                ],825                [826                    8,827                    61828                ],829                [830                    49,831                    12832                ],833                [834                    29,835                    37836                ],837                [838                    59,839                    99840                ],841                [842                    16,843                    93844                ],845                [846                    32,847                    7848                ],849                [850                    26,851                    65852                ],853                [854                    61,855                    53856                ],857                [858                    12,859                    78860                ],861                [862                    59,863                    44864                ],865                [866                    17,867                    55868                ],869                [870                    16,871                    1872                ],873                [874                    93,875                    84876                ],877                [878                    11,879                    27880                ],881                [882                    61,883                    81884                ],885                [886                    43,887                    12888                ],889                [890                    60,891                    44892                ],893                [894                    71,895                    19896                ],897                [898                    86,899                    27900                ],901                [902                    69,903                    96904                ],905                [906                    12,907                    47908                ],909                [910                    12,911                    82912                ],913                [914                    69,915                    1916                ],917                [918                    65,919                    19920                ],921                [922                    79,923                    61924                ],925                [926                    99,927                    35928                ],929                [930                    43,931                    98932                ],933                [934                    95,935                    34936                ]937            ],938            "output": 7812939        },940        {941            "input": [942                [943                    86,944                    75945                ],946                [947                    71,948                    72949                ],950                [951                    35,952                    60953                ],954                [955                    25,956                    82957                ],958                [959                    6,960                    54961                ],962                [963                    38,964                    8965                ],966                [967                    97,968                    15969                ],970                [971                    31,972                    75973                ],974                [975                    4,976                    14977                ],978                [979                    10,980                    1981                ],982                [983                    78,984                    6985                ],986                [987                    5,988                    45989                ],990                [991                    92,992                    28993                ],994                [995                    37,996                    41997                ],998                [999                    93,1000                    781001                ],1002                [1003                    90,1004                    231005                ],1006                [1007                    25,1008                    201009                ],1010                [1011                    41,1012                    821013                ],1014                [1015                    35,1016                    51017                ],1018                [1019                    66,1020                    971021                ],1022                [1023                    49,1024                    481025                ],1026                [1027                    76,1028                    831029                ],1030                [1031                    82,1032                    381033                ],1034                [1035                    42,1036                    991037                ],1038                [1039                    79,1040                    571041                ],1042                [1043                    100,1044                    741045                ],1046                [1047                    17,1048                    961049                ],1050                [1051                    71,1052                    971053                ],1054                [1055                    24,1056                    321057                ],1058                [1059                    24,1060                    991061                ],1062                [1063                    53,1064                    841065                ],1066                [1067                    47,1068                    81069                ],1070                [1071                    47,1072                    961073                ],1074                [1075                    86,1076                    61077                ],1078                [1079                    87,1080                    611081                ],1082                [1083                    6,1084                    821085                ],1086                [1087                    9,1088                    481089                ],1090                [1091                    60,1092                    911093                ],1094                [1095                    68,1096                    51097                ],1098                [1099                    88,1100                    231101                ],1102                [1103                    59,1104                    221105                ],1106                [1107                    24,1108                    111109                ],1110                [1111                    56,1112                    921113                ],1114                [1115                    31,1116                    811117                ],1118                [1119                    41,1120                    731121                ],1122                [1123                    25,1124                    831125                ],1126                [1127                    83,1128                    271129                ],1130                [1131                    51,1132                    811133                ],1134                [1135                    28,1136                    371137                ],1138                [1139                    65,1140                    881141                ],1142                [1143                    25,1144                    181145                ],1146                [1147                    100,1148                    71149                ],1150                [1151                    7,1152                    251153                ],1154                [1155                    11,1156                    801157                ],1158                [1159                    52,1160                    561161                ],1162                [1163                    2,1164                    751165                ],1166                [1167                    38,1168                    61169                ],1170                [1171                    99,1172                    591173                ],1174                [1175                    11,1176                    961177                ],1178                [1179                    79,1180                    401181                ],1182                [1183                    30,1184                    201185                ],1186                [1187                    45,1188                    561189                ],1190                [1191                    74,1192                    551193                ],1194                [1195                    86,1196                    901197                ],1198                [1199                    3,1200                    16

Showing the first 1,200 of 2497 lines. Download the file for the rest.