You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/main/java/com/fishercoder/solutions/_296.java
+30-24Lines changed: 30 additions & 24 deletions
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,11 @@
5
5
importjava.util.List;
6
6
7
7
/**
8
-
* A group of two or more people wants to meet and minimize the total travel distance. You are given a 2D grid of values 0 or 1, where each 1 marks the home of someone in the group. The distance is calculated using Manhattan Distance, where distance(p1, p2) = |p2.x - p1.x| + |p2.y - p1.y|.
8
+
* 296: Best Meeting Point
9
+
*
10
+
* A group of two or more people wants to meet and minimize the total travel distance.
11
+
* You are given a 2D grid of values 0 or 1, where each 1 marks the home of someone in the group.
12
+
* The distance is calculated using Manhattan Distance, where distance(p1, p2) = |p2.x - p1.x| + |p2.y - p1.y|.
9
13
10
14
For example, given three people living at (0,0), (0,4), and (2,2):
11
15
@@ -17,36 +21,38 @@ For example, given three people living at (0,0), (0,4), and (2,2):
17
21
The point (0,2) is an ideal meeting point, as the total travel distance of 2+2+2=6 is minimal. So return 6.
0 commit comments