February 21 - Using Ruby's Detect Method to Find Divisible Numbers
In this guide you'll learn how to find divisible numbers by leveraging Ruby's detect method.
Guide Tasks
  • Read Tutorial
  • Watch Guide Video
  • Complete the Exercise
Video locked
This video is viewable to users with a Bottega Bootcamp license

Summary

Build a method that finds the first divisible number of two integers.

Exercise Description

Given two integers, build a method that returns the first number that is divisible by both numbers.

Sample Input

Given the numbers:

12, 16

Expected Output

48

Real World Usage

Finding divisible numbers is a common coding interview question. Additionally, it's an important concept when working with mathematical equations.

Test Cases

Code File