Skip to content

Commit b956abc

Browse files
committed
Completed Dailies
1 parent 934e442 commit b956abc

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
class Solution {
2+
public:
3+
bool checkStraightLine(vector<vector<int>>& coordinates)
4+
{
5+
if(coordinates.size()==2)
6+
{
7+
return true;
8+
}
9+
10+
for(int i = 2;i<coordinates.size();i++)
11+
{
12+
if(((coordinates[i][1]-coordinates[0][1])*(coordinates[1][0]-coordinates[0][0])) != ((coordinates[1][1] - coordinates[0][1])*(coordinates[i][0]-coordinates[0][0])))
13+
{
14+
return false;
15+
}
16+
}
17+
return true;
18+
19+
}
20+
};

0 commit comments

Comments
 (0)