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.
Project Euler: Problem 1, Multiples of 3 and 5
1571 Solvers
292 Solvers
We love vectorized solutions. Problem 1 : remove the row average.
571 Solvers
431 Solvers
387 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!