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.
Well, I took a look at your code, and it does look like your algorithm is transparently correct. However, I submitted in Python, so I wonder if this is an issue with dealing with the unreasonably large numbers.
Unfortunately, I'm not a C expert, so maybe someone who is could answer that.
Maybe try rewriting in another language and see if your algorithm pans out there (mine was slightly different, but I don't think in any significant way).
Sorry I wasn't able to identify the issue, and good luck resolving it.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Sherlock and Pairs
You are viewing a single comment's thread. Return to all comments →
Well, I took a look at your code, and it does look like your algorithm is transparently correct. However, I submitted in Python, so I wonder if this is an issue with dealing with the unreasonably large numbers. Unfortunately, I'm not a C expert, so maybe someone who is could answer that. Maybe try rewriting in another language and see if your algorithm pans out there (mine was slightly different, but I don't think in any significant way).
Sorry I wasn't able to identify the issue, and good luck resolving it.