Partition Array Such That Maximum Difference Is K | Leetcode 2294