由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - sum of set difference min
相关主题
问个微软面试题Minimum number of moves to make an integer array balance
divide array into two, sum of difference is min in O(N)想在美国做导游学什么
问EPI一题New opening in Shanghai: Customer Support Engineer
请教一个面试题1st Amazon phone interview (1hr)
经常问的项目相关的behavior question怎么回答?问个面试题
一道google 经典题C/C++ Questions
问1道array hop的题cost of living in different cities 的问题。。
lc新题,贴个刚写的solutionbloomberg电面
相关话题的讨论汇总
话题: arrays话题: sum话题: minimum话题: three话题: find
进入JobHunting版参与讨论
1 (共1页)
r*****e
发帖数: 146
1
Given n arrays, find n number such that sum of their differences is minimum.
For e.g. if there are three arrays
A = {4, 10, 15, 20}
B = {1, 13, 29}
C = {5, 14, 28}
find three numbers a, b, c such that |a-b| + |b-c| + |c-a| is minimum. Here
the answer is a = 15, b = 13, and c = 14.
It seems an old question. Any idea would be appreciated. Thanks! :)
c**s
发帖数: 159
2
类似归并排序那样,每次最小的往前移动一次。
1 (共1页)
进入JobHunting版参与讨论
相关主题
bloomberg电面经常问的项目相关的behavior question怎么回答?
问一道简单DP题一道google 经典题
问一道有趣的面试题问1道array hop的题
one C++ questionlc新题,贴个刚写的solution
问个微软面试题Minimum number of moves to make an integer array balance
divide array into two, sum of difference is min in O(N)想在美国做导游学什么
问EPI一题New opening in Shanghai: Customer Support Engineer
请教一个面试题1st Amazon phone interview (1hr)
相关话题的讨论汇总
话题: arrays话题: sum话题: minimum话题: three话题: find