March 4 - Implement Range Finder Method in Ruby
This guide examines how to find the range of values in an integer based array by returning an array that contains the high and low values.
Guide Tasks
- Read Tutorial
- Watch Guide Video
- Complete the Exercise
Video locked
This video is viewable to users with a Bottega Bootcamp license
Already a Bottega Student? Sign In
Summary
Implement a method that indicates the range of values contained in an array of integers.
Exercise Description
Given an array of integers, build a method that returns an array that contains two elements, the low and high values of the array. This will indicate the full range of values contained in the array.
Example Input
To return the count by itself:
[5, 1, 3, 11, 100, 23]. array_range_finder # [1, 100]
Real World Usage
This exercise will walk through your knowledge of ranges, specifically, you will need to know how to find the low and high values in an array and how to combine them and return an array that contains them.