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.
Calculating the boundaries of the square is the nub of this question.
I had considered a square to be enclosed by two pairs of parallel lines at right angles and sides of equal length which it is. The output from my code for the square somtimes differed a little from HR output. Changing from int to float types helped, but the answer seems to need the hacker to consider the square as 2 triangles.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
A Circle and a Square
You are viewing a single comment's thread. Return to all comments →
Calculating the boundaries of the square is the nub of this question. I had considered a square to be enclosed by two pairs of parallel lines at right angles and sides of equal length which it is. The output from my code for the square somtimes differed a little from HR output. Changing from int to float types helped, but the answer seems to need the hacker to consider the square as 2 triangles.