Input{"boxTypes":[[100000,100000],[99999,99999],[99998,99998],[99997,99997],[99996,99996],[99995,99995],[99994,99994],[99993,99993],[99992,99992],[99991,99991],[99990,99990],[99989,99989],[99988,99988],[99987,99987],[99986,99986],[99985,99985],[99984,99984],[99983,99983],[99982,99982],[99981,99981],[99980,99980],[99979,99979],[99978,99978],[99977,99977],[99976,99976],[99975,99975],[99974,99974],[99973,99973],[99972,99972],[99971,99971],[99970,99970],[99969,99969],[99968,99968],[99967,99967],[99966,99966],[99965,99965],[99964,99964],[99963,99963],[99962,99962],[99961,99961],[99960,99960],[99959,99959],[99958,99958],[99957,99957],[99956,99956],[99955,99955],[99954,99954],[99953,99953],[99952,99952],[99951,99951],[99950,99950],[99949,99949],[99948,99948],[99947,99947],[99946,99946],[99945,99945],[99944,99944],[99943,99943],[99942,99942],[99941,99941],[99940,99940],[99939,99939],[99938,99938],[99937,99937],[99936,99936],[99935,99935],[99934,99934],[99933,99933],[99932,99932],[99931,99931],[99930,99930],[99929,99929],[99928,99928],[99927,99927],[99926,99926],[99925,99925],[99924,99924],[99923,99923],[99922,99922],[99921,99921],[99920,99920],[99919,99919],[99918,99918],[99917,99917],[99916,99916],[99915,99915],[99914,99914],[99913,99913],[99912,99912],[99911,99911],[99910,99910],[99909,99909],[99908,99908],[99907,99907],[99906,99906],[99905,99905],[99904,99904],[99903,99903],[99902,99902],[99901,99901],[99900,99900],[99899,99899],[99898,99898],[99897,99897],[99896,99896],[99895,99895],[99894,99894],[99893,99893],[99892,99892],[99891,99891],[99890,99890],[99889,99889],[99888,99888],[99887,99887],[99886,99886],[99885,99885],[99884,99884],[99883,99883],[99882,99882],[99881,99881],[99880,99880],[99879,99879],[99878,99878],[99877,99877],[99876,99876],[99875,99875],[99874,99874],[99873,99873],[99872,99872],[99871,99871],[99870,99870],[99869,99869],[99868,99868],[99867,99867],[99866,99866],[99865,99865],[99864,99864],[99863,99863],[99862,99862],[99861,99861],[99860,99860],[99859,99859],[99858,99858],[99857,99857],[99856,99856],[99855,99855],[99854,99854],[99853,99853],[99852,99852],[99851,99851],[99850,99850],[99849,99849],[99848,99848],[99847,99847],[99846,99846],[99845,99845],[99844,99844],[99843,99843],[99842,99842],[99841,99841],[99840,99840],[99839,99839],[99838,99838],[99837,99837],[99836,99836],[99835,99835],[99834,99834],[99833,99833],[99832,99832],[99831,99831],[99830,99830],[99829,99829],[99828,99828],[99827,99827],[99826,99826],[99825,99825],[99824,99824],[99823,99823],[99822,99822],[99821,99821],[99820,99820],[99819,99819],[99818,99818],[99817,99817],[99816,99816],[99815,99815],[99814,99814],[99813,99813],[99812,99812],[99811,99811],[99810,99810],[99809,99809],[99808,99808],[99807,99807],[99806,99806],[99805,99805],[99804,99804],[99803,99803],[99802,99802],[99801,99801],[99800,99800]],"truckSize":1000000000}
Expectednull
⏱ Performance - must finish in 2000ms
Large input with n=100 and large truckSize to test O(n log n) sorting + greedy approach within 2 seconds.
✓ Efficient O(n log n) sorting and greedy approach confirmed.