Maximize the Minimum Stock Level

Asked at Amazon · Coding Questions · Difficulty: Hard

Given positive `stock_arr`, and `inc_val <= dec_val`, an operation picks two distinct positions `p, q`, increasing `stock_arr[p]` by `inc_val` and decreasing `stock_arr[q]` by `dec_val`, any number of times. After all operations every value must be strictly greater than 0. Maximize the minimum value and return it.

Loading the problem…