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.
For those who are still trying to understand the question...
You run through some integers to check them against the arrays, whether they match the expecations as the two given. When they do, these integers become the answer.
So lets say we are investigating integer X. The integer X has to be
--> Perfectly divisible by all elements in the first array. If you divide X by any integer from the array, you would need to get a full number. This by definition means that the elements of such array would be factors of X. Such condition can be checked by the MOD function, which returns the remainder of division, where X % Array1Element = 0
--> Perfectly divide into all elements in the second array. Each element divided by X would produce an integer result. Such that Array2Element % X = 0
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Between Two Sets
You are viewing a single comment's thread. Return to all comments →
For those who are still trying to understand the question...
You run through some integers to check them against the arrays, whether they match the expecations as the two given. When they do, these integers become the answer.
So lets say we are investigating integer X. The integer X has to be
--> Perfectly divisible by all elements in the first array. If you divide X by any integer from the array, you would need to get a full number. This by definition means that the elements of such array would be factors of X. Such condition can be checked by the MOD function, which returns the remainder of division, where X % Array1Element = 0
--> Perfectly divide into all elements in the second array. Each element divided by X would produce an integer result. Such that Array2Element % X = 0