【Microsoft 】Partition array into N subsets with balanced sum Microsoft OA 开发岗 数据岗

喵贵妃 2020-6-2 713


Give you one sorted array, please put them into n buckets, we need to ensure we get n sub array with approximately equal weights. Example; input {1, 2, 3, 4, 5} n = 3 output [[[5],[1,4],[2,3]];

最新回复 (0)
返回