you assign box truck you give 2D array boxtypes boxTypesi numberOfBoxesi numberOfUnitsPerBoxinumberOfBoxesi number box type inumberofunitsperboxi number unit box type iYou give integer trucksize maximum number box truck you choose box truck long number box exceed trucksizereturn maximum total number unit truck example 1input boxtypes 132231 trucksize 4Output 8explanation there 1 box type contain 3 unit 2 box second type contain 2 unit 3 box type contain 1 unit eachyou box second type box typethe total number unit 1 3 2 2 1 1 8example 2input boxtypes 510254739 truckSize 10output 91 Constraints1 boxtypeslength 10001 numberOfBoxesi numberofunitsperboxi 10001 truckSize 106