Company: Goldman_Sachs__
Difficulty: medium
Optimal Warehouse Placement Problem Description You are managing a network of departmental stores on a very long street. You are given an array storeLocations where storeLocations[i] represents the location of the ith branch along the street. To improve the logistics and reduce travel time, you want to establish k warehouses. The objective is to place the k warehouses on the street such that the sum of distance of each store to its nearest warehouse is minimum. * Note 1: The warehouses can only be placed on integer locations on the street. * Note 2: A warehouse can be placed at the same integer location as a store. Examples Sample Input 0 5 1 3 8 11 (Note: The exact interpretation of this input (e.g., which number represents k and which represent storeLocations, and if the input is complete) and the corresponding output are not provided in the image.) Constraints * 1 <= k <= storeLocations.length <= 100 * 1 <= storeLocations[i] <= 10^4 * All integers in storeLocations are unique.