Skip to content

Latest commit

 

History

History
8 lines (7 loc) · 554 Bytes

102-slope-of-a-line.md

File metadata and controls

8 lines (7 loc) · 554 Bytes

Problem:

Task

Your challenge is to write a function named getSlope/get_slope/GetSlope that calculates the slope of the line through two points.

Input

Each point that the function takes in is an array 2 elements long. The first number is the x coordinate and the second number is the y coordinate. If the line through the two points is vertical or if the same point is given twice, the function should return null/None.

Solution