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.
I think test case 6 is incorrect.
Given:
n=5 k=1
s = [1 2 3 4 5]
The "correct" output is 1 but all whole numbers are divisible by 1. Shouldn't the actual answer be 0 since a subset of size zero has no elements divisible by k?
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Non-Divisible Subset
You are viewing a single comment's thread. Return to all comments →
I think test case 6 is incorrect. Given: n=5 k=1 s = [1 2 3 4 5] The "correct" output is 1 but all whole numbers are divisible by 1. Shouldn't the actual answer be 0 since a subset of size zero has no elements divisible by k?