Problem 46093. GCD
42.47% Correct | 57.53% Incorrect
Last Solution submitted on Oct 27, 2022
Dyuman Joshi on 5 Dec 2020
The solution is a bit flawed as it works for the limited test cases in this problem.
A classic approach was to take intersection of factors of a and b, and take their product. This works perfectly on paper. However, the inbuilt intersect() function gives unique values discarding the repeated values, thus I was not able to use it.
Problem Recent Solvers29
Compute a dot product of two vectors x and y
Volume difference between Ellipsoid and Sphere
Basic commands - Greatest common divisor
More from this Author165
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!