A construction company owner has surplus metal rods of arbitrary lengths. A contractor will buy rods of the same exact integer length (saleLength). Rods can be cut to increase the number of sellable rods, but each cut costs costPerCut. Any leftover rods not matching saleLength are discarded.
The total profit is calculated as: totalProfit = totalUniformRods × saleLength × salePrice - totalCuts × costPerCut
Find the saleLength that maximizes profit.
Expert in Data Structures & Algorithms. Building tools to help developers crack FAANG interviews.
IndiaMART • Pending
Amazon • Pending
Amazon • Pending
Code with cisco - CwC 26 • Pending
Code with cisco - CwC 26 • Pending