Get Minimum Cost
Learn this problemProblem statement
In an edge computing environment, required hardware includes edge devices, input peripherals, and bundles that encompass both types. Each resource comes at a cost, with edge devices priced at edgeDeviceCost, peripherals at inputPeripheralCost, and bundles at bundleCost.
The challenge is to optimize the procurement of resources. The objective is to ensure the provision of the right quantities of edge devices and peripherals, allowing for a degree of flexibility, and accommodating extra equipment. This flexibility is provided to meet the requirements of the environment, which necessitates x edge devices and y peripherals. The primary goal is to minimize costs while simultaneously guaranteeing that the edge computing environment is equipped with all the essential resources. Compute and return the total expenditure.
Function
getMinimumCost(edgeDeviceCost: int, inputPeripheralCost: int, bundleCost: int, x: int, y: int) → long
Complete the function getMinimumCost in the editor.
getMinimumCost has the following parameter(s):
int edgeDeviceCost: the cost of an edge deviceint inputPeripheralCost: the cost of an input peripheralint bundleCost: the cost of a bundle containing both, an edge device and an input peripheralint x: the number of edge devices requiredint y: the number of input peripherals required
Returns
long: the minimum expenditure necessary to ensure that the edge computing environment fully equipped
Constraints
- 1 ≤ edgeDeviceCost, inputPeripheralCost, bundleCost, x, y ≤ 10^9
🌷 spike, for the 1012nd time — thank you! ♡〜٩( ˃▿˂)۶〜
Examples
Example 1
edgeDeviceCost = 3inputPeripheralCost = 2bundleCost = 1x = 4y = 3return = 4Example 2
edgeDeviceCost = 1inputPeripheralCost = 20bundleCost = 5x = 9y = 1return = 13Example 3
edgeDeviceCost = 1inputPeripheralCost = 2bundleCost = 2x = 2y = 1return = 3Constraints
1 ≤ edgeDeviceCost, inputPeripheralCost, bundleCost, x, y ≤ 10^9More IBM problems
- Parent Process NumberOA · Seen Jul 2026
- Request Retry CountOA · Seen Jul 2026
- Count Strictly Increasing Subsequences of Length 3OA · Seen Jul 2026
- Maximum Requests in a Time WindowOA · Seen Jul 2026
- Query Type Frequency WindowOA · Seen Jul 2026
- Minimum Number of Non-Empty Disjoint SegmentsOA · Seen Jul 2026
- Spam Text ClassificationOA · Seen Jul 2026
- Count Ideal NumbersOA · Seen Jun 2026