请教一道two sigma的面试题# JobHunting - 待字闺中
x*n
1 楼
这道题自己实在是完全没有头绪
Write a program to synchronize data sets between data centers using as few
copies as possible.
Example 1: ---------- Input: 4 1 3 4 1 2 3 1 3 1 4 2 One Possible Correct
Output: 2 2 1 4 1 2 2 2 3 4 4 3 3 1 4 done
nput:
line1: number of data sets
line2,3,4... = the actual data sets
Output:
optimal copy strategy:
each line must contain one copy instruction
Eg: 4 1 2 means move number 4 from data set 1 to data set 2
Write a program to synchronize data sets between data centers using as few
copies as possible.
Example 1: ---------- Input: 4 1 3 4 1 2 3 1 3 1 4 2 One Possible Correct
Output: 2 2 1 4 1 2 2 2 3 4 4 3 3 1 4 done
nput:
line1: number of data sets
line2,3,4... = the actual data sets
Output:
optimal copy strategy:
each line must contain one copy instruction
Eg: 4 1 2 means move number 4 from data set 1 to data set 2