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.
2418 Solvers
192 Solvers
Sum the real and imaginary parts of a complex number
117 Solvers
Determine the Anti-diagonal of a Magic Square
85 Solvers
Find out sum and carry of Binary adder
405 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!