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.
I feel like I'm cheating with this one. I just rounded down (N/2)^2. It passed all the tests, but I can't get over the feeling that this should not have cut it.
Here's the JS:
Math.floor(Math.pow((lines[i]/2),2))
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Halloween party
You are viewing a single comment's thread. Return to all comments →
I feel like I'm cheating with this one. I just rounded down
(N/2)^2
. It passed all the tests, but I can't get over the feeling that this should not have cut it.Here's the JS: