shlogg · Early preview
Md Ariful Haque @mah-shamim

Maximize Magnetic Force Between Balls In Baskets

Distribute m balls into n baskets at positions[i] to maximize min magnetic force between ball pairs |x - y|, where x and y are ball positions. Return required force.

1552. Magnetic Force Between Two Balls
Medium
In the universe Earth C-137, Rick discovered a special form of magnetic force between two balls if they are put in his new invented basket. Rick has n empty baskets, the ith basket is at position[i], Morty has m balls and needs to distribute the balls into the baskets such that the minimum magnetic force between any two balls is maximum.
Rick stated that magnetic force between two different balls at positions x and y is |x - y|.
Given the integer array position and the integer m. Return the required force.
Example 1:


Input: position = [1,2,3,4,7]...