Implement Range Finder Method in Ruby

0
252

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.

Summary

Implement a method that indicates the range of values contained in an array of integers.

Exercise File

Code File

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.

Solution

Can be found on the solutions branch on github.

LEAVE A REPLY

Please enter your comment!
Please enter your name here