brewersfan1976

minimal_multiple.rb

Jul 21st, 2016
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.27 KB | None | 0 0
  1. def minimalMultiple(divisor, lowerBound)
  2.     multiple = 1
  3.    
  4.     while(1)
  5.          result = divisor * multiple
  6.        
  7.          if result >= lowerBound then
  8.             return result
  9.          end
  10.              
  11.          multiple = multiple + 1
  12.      end
  13. end
Advertisement
Add Comment
Please, Sign In to add comment