re: Daily Challenge #84 - Third Angle of a Triangle VIEW POST

FULL DISCUSSION
 

Solution in APL

(using Dyalog APL)

thirdAngle←{r←180-+/⍵ ⋄ (r<0)∨0∊⍵: 'This is not a triangle!' ⋄ r}

Tests:

      thirdAngle 30 60
90
      thirdAngle 60 60
60
      thirdAngle 43 78
59
      thirdAngle 10 20
150

Try it online!

code of conduct - report abuse