You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please check if there's a test that states that a triangle with sides 2, 4, 2 is invalid. The triangle inequality states that for any triangle, the sum of the lengths of any two sides must be greater than or equal to the length of the remaining side. If this doesn't affect this track, go ahead and just close the issue.
The text was updated successfully, but these errors were encountered:
Use empty lines between top-level forms.
Exclude #'clojure.core/type to avoid collision
Make #'triangle/type point-free and ~2x faster
If the sides are invalid, there's no need to compute the set.
Unlike cond, case does a constant-time dispatch. Since we're effectively
performing case analysis on 1 and 2 (constants), we might as well use
case instead of cond. The point-free-ness of this change is both a
matter of personal taste and "lazy" evaluation, i.e. don't compute
unnecessary values.
The previous solution's use of:
(partition-by identity (sort [a b c]))
... is unnecessarily complex.
(hash-set a b c)
... gets the job done more simply.
Fix#95https://github.com/bbatsov/clojure-style-guide#empty-lines-between-top-level-forms
Please check if there's a test that states that a triangle with sides 2, 4, 2 is invalid. The triangle inequality states that for any triangle, the sum of the lengths of any two sides must be greater than or equal to the length of the remaining side. If this doesn't affect this track, go ahead and just close the issue.
The text was updated successfully, but these errors were encountered: