// Formula
// a^2 + b^2 = c^2
// base as a leg
// altitude as b leg
// hypotenuse as c leg
function pythagorean(base,altitude,hypotenuse) {
if (base=== "?") {
let bSqure= altitude*altitude
let cSqure= hypotenuse*hypotenuse
let aSqure= cSqure - bSqure
return Math.sqrt(aSqure)
}
if (altitude === "?") {
let aSqure= base*base
let cSqure= hypotenuse*hypotenuse
let bSqure= cSqure - aSqure
return Math.sqrt(bSqure)
}
if (hypotenuse === "?") {
return Math.sqrt( base*base + altitude*altitude)
}
}
console.log(pythagorean("?",5,13));
console.log(pythagorean(6,8,"?"));
console.log(pythagorean(3,4,"?"));
console.log(pythagorean('?',8,16));
console.log(pythagorean(5,5,"?"));