7 kyu

Simple Fun #184: LCM from m to n

304 of 582myjinxin2015

Description:

Task

Your task is to find the smallest number which is evenly divided by all numbers between m and n (both inclusive).

Example

For m = 1, n = 2, the output should be 2.

For m = 2, n = 3, the output should be 6.

For m = 3, n = 2, the output should be 6 too.

For m = 1, n = 10, the output should be 2520.

Input/Output

  • [input] integer m

1 ≤ m ≤ 25

  • [input] integer n

1 ≤ n ≤ 25

  • [output] an integer
Fundamentals

Stats:

CreatedMar 6, 2017
PublishedMar 6, 2017
Warriors Trained1705
Total Skips64
Total Code Submissions1998
Total Times Completed582
JavaScript Completions162
C# Completions63
PHP Completions53
Python Completions304
Ruby Completions42
C Completions18
Total Stars32
% of votes with a positive feedback rating92% of 162
Total "Very Satisfied" Votes140
Total "Somewhat Satisfied" Votes18
Total "Not Satisfied" Votes4
Total Rank Assessments6
Average Assessed Rank
7 kyu
Highest Assessed Rank
7 kyu
Lowest Assessed Rank
7 kyu
Ad
Contributors
  • myjinxin2015 Avatar
  • smile67 Avatar
  • donaldsebleung Avatar
  • rowcased Avatar
  • hobovsky Avatar
  • Just4FunCoder Avatar
  • saudiGuy Avatar
Ad