25
Last seen 2 months ago
Member for 5 years, 10 months, 28 days
Difficulty Easy
Using **p** instead of function parameter **password**. Genius tip to save space!
More
Genius! # will stick to integer arithmetic only --> +1. Also, +1 for side2 instead of side almost in everyone’s code. Love it! Hands down the best Similar Triangles solution I found so far!
More
Could have used from math import dist and AB = dist(coords_1[0], coords_1[1]). :-)
More
Seems to be the most comprehensible solution from a hundred or so I just looked through!
More
No need to use import math, math.sqrt, abs here. Function side will logically become side_squared, the similarity check will produce the same result. Love your ends list!
More
+1 for dist meaning dist**2 -- no need to use sqrt and no effect on similarity
More
Even better,
return sides1[0]*sides2[1] == sides1[1]*sides2[0] and sides1[0]*sides2[2] == sides1[2]*sides2[0]
would have eliminated all float and rounding trouble.
Also, +1 for length**2 instead of length.
More