We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
To solve for N dimensions Pythagorean Theorem works for all of them
x^2 + y^2 + z^2 .... + N^2 = H^2. I solved it in python idle. To switch between int and array I used a Try Exception block with Invalid type for when going through the dimension array.
But that is way more complicated than this. I solved for N dimensions for fun.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Cats and a Mouse
You are viewing a single comment's thread. Return to all comments →
To solve for N dimensions Pythagorean Theorem works for all of them x^2 + y^2 + z^2 .... + N^2 = H^2. I solved it in python idle. To switch between int and array I used a Try Exception block with Invalid type for when going through the dimension array.
But that is way more complicated than this. I solved for N dimensions for fun.