Calculate the length of the short side, a, of a right-angled triangle with hypotenuse of length c, and other short side of length b.
Image courtesy of Wikipedia.
Tanya, you like triangles.
Good one
ez
test_1 a=sqrt(3) is longer than b=1
the good solution would be
a= min(sqrt(c^2 -b^2),b)
instead
regexp cheat
Kudos for finding this solution - it did indeed meet all the test cases, but wasn't quite what I had in mind! I will add a new test.
Number of 1s in the Binary Representation of a Number
319 Solvers
896 Solvers
309 Solvers
Create an index-powered vector
232 Solvers
ベクトル [1 2 3 4 5 6 7 8 9 10] の作成
197 Solvers