Minimize Total Effort by Divisor Assignment

Asked at Amazon · Coding Questions · Difficulty: Medium

Given an array `effort`, you may repeatedly pick positions `i, j` such that `effort[i]` is divisible by `effort[j]`, and set `effort[i] = effort[j]`. Return the minimum possible total effort after any number of operations.

Loading the problem…