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.
Just had a small doubt, suppose the array is {15, 16, 17, 18, 19}, total size of 'a' will be 5. Now suppose k = 31.
Then a[31 - 15] = a[16], which will be out of bounds.
same will happen with a[15];
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 →
Just had a small doubt, suppose the array is {15, 16, 17, 18, 19}, total size of 'a' will be 5. Now suppose k = 31. Then a[31 - 15] = a[16], which will be out of bounds. same will happen with a[15];