We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f8ebc59 commit e15a0bfCopy full SHA for e15a0bf
1232/README.md
@@ -0,0 +1,3 @@
1
+# Hi, rahulvansh66! Here is my help . My code is on Python3 scenario
2
+
3
1232/leetcode1232.py
@@ -0,0 +1,14 @@
+import math
+class Solution:
+ def checkStraightLine(self, coord: List[List[int]]) -> bool:
4
+ coord = sorted(coord)
5
+ x = []
6
+ for i in range(len(coord)-1):
7
+ if((coord[i][0] - coord[i+1][0])==0):
8
+ if((coord[i][1] - coord[i+1][1])>0):
9
+ x.append(math.atan(float("inf")))
10
+ elif((coord[i][1] - coord[i+1][1])<0):
11
+ x.append(math.atan(float("-inf")))
12
+ else:
13
+ x.append(math.atan((coord[i][1] - coord[i+1][1])/(coord[i][0] - coord[i+1][0])))
14
+ return True if(len(set(x))== 1) else False
0 commit comments