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.
It is an optimal solution, but keep in mind: Reading the input sizes is really important in a competition. Here we have N <= 100 and it would be a waste of time to implement the optimal solution. For N <= 10^9 however, this optimal solution would be better.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Divisible Sum Pairs
You are viewing a single comment's thread. Return to all comments →
It is an optimal solution, but keep in mind: Reading the input sizes is really important in a competition. Here we have N <= 100 and it would be a waste of time to implement the optimal solution. For N <= 10^9 however, this optimal solution would be better.