Skip to content

Commit 388d3a6

Browse files
authored
Remove Duplicate Points
1 parent a3dada2 commit 388d3a6

File tree

1 file changed

+1
-0
lines changed
  • chapters/computational_geometry/gift_wrapping/graham_scan/code/python

1 file changed

+1
-0
lines changed

chapters/computational_geometry/gift_wrapping/graham_scan/code/python/grahamScan.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ def polar_angle(ref, point):
1212

1313

1414
def graham_scan(gift):
15+
gift = list(set(gift)) #Remove duplicate points
1516
start = min(gift, key=lambda p: (p[1], p[0])) #Must be in hull
1617
gift.remove(start)
1718

0 commit comments

Comments
 (0)