Description
Solutions
Minimize Effort with EffiBin Kit
πŸ‘©β€πŸŽ“ NEW GRADπŸ”₯ FULLTIME

Not entirely sure for NG or FT, so I label both. Will update find more reliable source! :P

With Amazon's new innovative EffiBin Kit users can effortlessly optimize the arrangement of their storage bins. This kit is designed to minimize the overall effort needed for efficient organization. The process starts with an array of bins, and the objective is to reduce the total effort required. The effort is the sum of efforts needed for each bin.

Formally, given an array effort of size n, utilizing the EffiBin Kit, users can perform operations on the array, in each operation, the user chooses two positions i and j, such that the effort of the bin at position i (effort[i]) is divisible by the effort of the bin at position j (effort[j]). When this condition is satisfied, the effort of bin i can be updated to equal the effort of bin j. This operation can be repeated as many times as possible, on different bins or positions.

An integer x is divisible by another integer y if x can be divided by y exactly, with nothing left over, for example, 6 is divisible by 3, while 7 is not.

Find the minimum total effort after applying some (possibly zero) number of operations.

𓂃 ོ𓂃Many Thanks to Spike!𓂃 π“ˆ’π“Έ

Example 1:

Input:  effort = [3, 6, 2, 5, 25]
Output: 17
Explanation:
Constraints:
    • 1 <= n <= 2 * 105
    • 1 <= effort[i] <= 2 * 105
Thumbnail 0
Testcase

Result
Case 1

input:

output: