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

FULL DISCUSSION
 

Keeping it simple in bash

function thirdAngle {
  echo $((180 - $1 - $2))
}

Running through the examples on the cmd:

> thirdAngle 30 60
90

> thirdAngle 60 60
60

> thirdAngle 43 78
59

> thirdAngle 10 20
150
 

BTW the challenge on Kata only tests for valid triangles,

function otherAngle(a, b) {
  return 180-(a+b);
}

was sufficient in JS

code of conduct - report abuse