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.
If not, the tutorial has a different solution (which is arguably of the same complexity of my answer but I would believe somewhat slower). Please do feel free to test alternative -> that is what makes HackerRank interesting.
You could investigate replacing maps with an array of count values but I would assume you'd exceed space restrictions.
Kind regards.
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 →
Dear yagyeshbagaya,
Then use maps!!!
If not, the tutorial has a different solution (which is arguably of the same complexity of my answer but I would believe somewhat slower). Please do feel free to test alternative -> that is what makes HackerRank interesting.
You could investigate replacing maps with an array of count values but I would assume you'd exceed space restrictions.
Kind regards.