Hackerrank – Between Two Sets

Hackerrank – Problem description

The problem description – Hackerrank.


I created an array of all positive numbers, which satisfy conditions specified in problem statement. This set should contain elements from 1 to 100. I filter all numbers from the set that are valid for an equation n % a_i == 0 a b_i % n == 0.

The array of positive numbers can be reduced. It could only contain numbers ranging from max(A) to min(B) (included). If an arbitrary number n is divisible with A – all elements less than a are not divisible without a remainder. The same holds for min(B). There would be a remainder for all numbers greater than



I created solution in:

All solutions are also available on my GitHub profile.





Leave a Reply

Your email address will not be published. Required fields are marked *