Cody

Problem 46096. LCM

Solution 2954593

Submitted on 16 Sep 2020 by Alfonso Nieto-Castanon
  • Size: 29
  • This is the leading solution.
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
assert(isequal(lc_cal(5,6),30))

2   Pass
assert(isequal(lc_cal(65,24843),124215))

3   Pass
assert(isequal(lc_cal(28851538,1183019),1933053046))

4   Pass
assert(isequal(lc_cal(3,9),9))

5   Pass
assert(isequal(lc_cal(1,1),1))

6   Pass
assert(isequal(lc_cal(6236412, 24228),12591315828))

7   Pass
filetext = fileread('lc_cal.m'); assert(isempty(strfind(filetext, 'gcd')),'gcd() forbidden') assert(isempty(strfind(filetext, 'lcm')),'lcm() forbidden')

Suggested Problems

More from this Author149

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!