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
|
3093 Discussions
|
Please Login in order to post a comment
Python 3 Solution, this isn't the most optimal code, but it gets the job done. You can use it as a reference, though I wouldn't recommend using it in practice. It's still better to prioritize finding the Least Common Multiple (LCM) and the Greatest Common Divisor (GCD)
Python solution
def getTotalX(a, b): # Write your code here x = max(a) y = min(b)
I like that it’s designed to cater to all skill levels, so anyone can understand and use it without confusion. Clear learning systems like this, similar to alphabet in morse code, make complex ideas much easier to grasp.
Was stuck with the problem as I was using int for input and return format in sub-function, but fixed it after using long. This is one of the correct code:
Most Optmized code: O(A)+O(B)+O((a_lcm/b_gcd)×B)
`