请教一个google的面试题# JobHunting - 待字闺中
u*7
1 楼
find a intersection to build office so that the sum of all employees'
commute distances is minimum.. (the map is represented as a m*n grid, you
are given each employee's coordination, they can only move in up-down and
left-right directions)
这题目除了O(mn)的brute force做法外,还有什么更加高效的吗。
谢谢了
commute distances is minimum.. (the map is represented as a m*n grid, you
are given each employee's coordination, they can only move in up-down and
left-right directions)
这题目除了O(mn)的brute force做法外,还有什么更加高效的吗。
谢谢了