CoolFace
Datasetpublic

FPEvalDataset/LeetCodeProblem

sourceHugging Faceupdated 8mo agoView on Hugging Face
0likes304downloads
1{2    "id": 3334,3    "name": "apple_redistribution_into_boxes",4    "difficulty": "Easy",5    "link": "https://leetcode.com/problems/apple-redistribution-into-boxes/",6    "date": "2024-03-03 00:00:00",7    "task_description": "You are given an array `apple` of size `n` and an array `capacity` of size `m`. There are `n` packs where the `ith` pack contains `apple[i]` apples. There are `m` boxes as well, and the `ith` box has a capacity of `capacity[i]` apples. Return _the **minimum** number of boxes you need to select to redistribute these _`n`_ packs of apples into boxes_. **Note** that, apples from the same pack can be distributed into different boxes. **Example 1:** ``` **Input:** apple = [1,3,2], capacity = [4,3,1,5,2] **Output:** 2 **Explanation:** We will use boxes with capacities 4 and 5. It is possible to distribute the apples as the total capacity is greater than or equal to the total number of apples. ``` **Example 2:** ``` **Input:** apple = [5,5,5], capacity = [2,4,2,7] **Output:** 4 **Explanation:** We will need to use all the boxes. ``` **Constraints:** `1 <= n == apple.length <= 50` `1 <= m == capacity.length <= 50` `1 <= apple[i], capacity[i] <= 50` The input is generated such that it's possible to redistribute packs of apples into boxes.",8    "public_test_cases": [9        {10            "label": "Example 1",11            "input": "apple = [1,3,2], capacity = [4,3,1,5,2]",12            "output": "2 "13        },14        {15            "label": "Example 2",16            "input": "apple = [5,5,5], capacity = [2,4,2,7]",17            "output": "4 "18        }19    ],20    "private_test_cases": [21        {22            "input": [23                [24                    12,25                    39,26                    47,27                    10,28                    21,29                    26,30                    7,31                    5032                ],33                [34                    49,35                    43,36                    35,37                    30,38                    29,39                    28,40                    24,41                    742                ]43            ],44            "output": 645        },46        {47            "input": [48                [49                    35,50                    48,51                    40,52                    16,53                    43,54                    36,55                    41,56                    457                ],58                [59                    46,60                    45,61                    45,62                    44,63                    43,64                    40,65                    38,66                    38,67                    36,68                    34,69                    34,70                    33,71                    30,72                    29,73                    28,74                    26,75                    25,76                    24,77                    22,78                    22,79                    19,80                    18,81                    17,82                    7,83                    2,84                    2,85                    2,86                    187                ]88            ],89            "output": 690        },91        {92            "input": [93                [94                    18,95                    45,96                    11,97                    47,98                    26,99                    2,100                    39,101                    48,102                    43,103                    16,104                    4,105                    17,106                    48,107                    44,108                    2,109                    21,110                    41,111                    40,112                    17,113                    29,114                    35,115                    23,116                    45,117                    30,118                    31,119                    34,120                    39121                ],122                [123                    205,124                    50,125                    45,126                    45,127                    45,128                    42,129                    39,130                    37,131                    35,132                    35,133                    31,134                    27,135                    26,136                    24,137                    24,138                    21,139                    21,140                    15,141                    14,142                    8,143                    6144                ]145            ],146            "output": 21147        },148        {149            "input": [150                [151                    46,152                    5,153                    6,154                    15,155                    47,156                    20,157                    16,158                    19,159                    42,160                    44,161                    44,162                    28,163                    28,164                    19,165                    16,166                    26,167                    47,168                    12,169                    39,170                    40,171                    25,172                    25,173                    48,174                    3,175                    17,176                    6,177                    21,178                    22,179                    20,180                    2,181                    50,182                    50,183                    26,184                    26,185                    41,186                    5,187                    9,188                    31,189                    19,190                    40,191                    26192                ],193                [194                    719,195                    50,196                    49,197                    41,198                    31,199                    28,200                    28,201                    23,202                    22,203                    20,204                    15,205                    11,206                    11,207                    10,208                    8,209                    5210                ]211            ],212            "output": 16213        },214        {215            "input": [216                [217                    14,218                    12,219                    1,220                    27,221                    27,222                    29,223                    14,224                    12,225                    7,226                    6,227                    8,228                    42,229                    34,230                    42,231                    44,232                    46,233                    27,234                    49,235                    36,236                    24237                ],238                [239                    163,240                    46,241                    44,242                    44,243                    40,244                    37,245                    35,246                    34,247                    25,248                    12,249                    9,250                    8,251                    4252                ]253            ],254            "output": 13255        },256        {257            "input": [258                [259                    28,260                    3,261                    15,262                    44,263                    49,264                    25,265                    11,266                    50,267                    32,268                    2269                ],270                [271                    43,272                    39,273                    37,274                    36,275                    35,276                    35,277                    33,278                    32,279                    28,280                    25,281                    20,282                    16,283                    16,284                    6,285                    3,286                    2287                ]288            ],289            "output": 8290        },291        {292            "input": [293                [294                    38,295                    42,296                    47,297                    16,298                    36299                ],300                [301                    50,302                    49,303                    48,304                    47,305                    47,306                    47,307                    44,308                    44,309                    42,310                    38,311                    36,312                    35,313                    35,314                    34,315                    34,316                    33,317                    31,318                    29,319                    29,320                    26,321                    26,322                    23,323                    19,324                    19,325                    18,326                    15,327                    14,328                    14,329                    13,330                    12,331                    12,332                    11,333                    8,334                    7,335                    7,336                    5,337                    4,338                    1,339                    1340                ]341            ],342            "output": 4343        },344        {345            "input": [346                [347                    44,348                    26,349                    43,350                    38,351                    50,352                    35,353                    36,354                    44,355                    25,356                    39,357                    16,358                    14,359                    26,360                    12,361                    3,362                    45,363                    21,364                    1,365                    4,366                    8,367                    35,368                    2,369                    33,370                    30,371                    9,372                    26,373                    20,374                    16,375                    14,376                    24,377                    43,378                    7379                ],380                [381                    271,382                    46,383                    42,384                    40,385                    40,386                    40,387                    39,388                    38,389                    36,390                    34,391                    28,392                    28,393                    27,394                    23,395                    19,396                    13,397                    11,398                    8,399                    6400                ]401            ],402            "output": 19403        },404        {405            "input": [406                [407                    49,408                    46,409                    14,410                    38,411                    24,412                    32,413                    16,414                    36,415                    22,416                    19,417                    48,418                    17,419                    43,420                    15,421                    9,422                    3,423                    18,424                    42,425                    4,426                    49,427                    12,428                    20,429                    16,430                    22,431                    11,432                    28,433                    36,434                    1,435                    7,436                    18,437                    49,438                    17,439                    3,440                    4,441                    36,442                    7,443                    37,444                    18,445                    7,446                    41,447                    18,448                    13,449                    5450                ],451                [452                    919,453                    30,454                    16,455                    5456                ]457            ],458            "output": 4459        },460        {461            "input": [462                [463                    41,464                    30,465                    18,466                    6467                ],468                [469                    41,470                    34,471                    20472                ]473            ],474            "output": 3475        }476    ],477    "haskell_template": "minimumBoxes :: [Int] -> [Int] -> Int\nminimumBoxes apple capacity ",478    "ocaml_template": "let minimumBoxes (apple: int list) (capacity: int list) : int =  ",479    "scala_template": "def minimumBoxes(apple: List[Int],capacity: List[Int]): Int = { \n    \n}",480    "java_template": "class Solution {\n    public int minimumBoxes(int[] apple, int[] capacity) {\n        \n    }\n}",481    "python_template": "class Solution(object):\n    def minimumBoxes(self, apple, capacity):\n        \"\"\"\n        :type apple: List[int]\n        :type capacity: List[int]\n        :rtype: int\n        \"\"\"\n        "482}