[Solved] algorithm to find the number of boxes needed for different lengths of cable [closed]
[ad_1] Set L = sum of lengths While L > 0 Get largest box B where size S <= L OR smallest box set numB = Floor division L / B OR 1 store numB of B Subtract numB * B from L you’ll need some adjustments for a case where you might have waste … Read more