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.
However you run into the possibility of straight division (/) giving you the wrong answer (or actually using floating point values when they are not necessary).
Also consider that division is much more expensive in computing terms than multiplication.
I'm glad however, that you were able to solve it. Unfortunately HR is not currently (as far as I know) showing processing times (so you could maybe compare to other solutions).
I always try to reduce both memory and processing times to a minimum.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Count Triplets
You are viewing a single comment's thread. Return to all comments →
However you run into the possibility of straight division (/) giving you the wrong answer (or actually using floating point values when they are not necessary). Also consider that division is much more expensive in computing terms than multiplication. I'm glad however, that you were able to solve it. Unfortunately HR is not currently (as far as I know) showing processing times (so you could maybe compare to other solutions). I always try to reduce both memory and processing times to a minimum.