Triangle Area From Points
points holds three corners [x, y] of a triangle, all integers. To avoid fractions, return twice the area of the triangle as an integer. If the three points lie on one line, the answer is 0.
Example 1
points [[0,0],[4,0],[0,3]]
returns 12
Area 6, so twice is 12.
Constraints
len(points) == 3- Coordinates are between -100 and 100
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.
More Math problems
- Ugly NumberEasy
- Water BottlesEasy
- Balanced Parentheses CountMedium
- Convert to Base Minus TwoMedium
- Count Numbers With Unique DigitsMedium
- Count PrimesMedium
- Day of the WeekMedium
- Fast PowerMedium