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'm not so sure that that solution has a time complexity of O(n log(n)). Sure the computation time will depend on the size of A, but also on the size of B, the size of the elements in A and B, and the number of multiples of lcm(A) less than or equal to gcd(B).
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 →
I'm not so sure that that solution has a time complexity of O(n log(n)). Sure the computation time will depend on the size of A, but also on the size of B, the size of the elements in A and B, and the number of multiples of lcm(A) less than or equal to gcd(B).