Min Incompatibility

Given an array and integer k, partition the array into k equal-sized subsets with distinct elements. Minimize the sum of each subset's incompatibility (max - min). Return -1 if impossible.

Examples
Input: [[1,2,3,4],2]
Output: 2
Hints

Min Incompatibility

Given an array and integer k, partition the array into k equal-sized subsets with distinct elements. Minimize the sum of each subset's incompatibility (max - min). Return -1 if impossible.