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.
Between Two Sets
Between Two Sets
Sort by
recency
|
3054 Discussions
|
Please Login in order to post a comment
Here is problem solution in Python, Java, C++, C and Javascript - https://programmingoneonone.com/hackerrank-between-two-sets-problem-solution.html
I'm having trouble understanding the problem here. The explanation is extremely detailed, but I'm not 100% sure how you take 2 and 6 and end up with 6 and 12, and then 2 numbers. Very confusing explanation.
I am confused by the question too. Let me try to rephrase. Given array A and array B of integers. Find length of answers where an answer is BOTH (i) factorized by all elements of A which means it is a common multiple of elements of A (ii) is a factor of elements of B
Example: a = [2, 6] b = [24, 36] aMultiple = [6, 12, 18, 24] answer = [6, 12] Example: a = [2, 4] b = [16, 32, 96] aMultiple = [4, 8, 12, 16] answer = [4, 8, 16]
JavaScript
Here is problem solution in Python Java C++ C and Javascript - https://programmingoneonone.com/hackerrank-between-two-sets-problem-solution.html
Oh, very clean!
additional code to restrict range based on inputs instead of 1 to 100; int startRange = a.get(a.size()-1); int endRange = b.get(0); for more Visit this website