Created
November 12, 2019 19:27
-
-
Save venelrene/5c5dc2d1bbd72a145dfd56a639fc2c3e to your computer and use it in GitHub Desktop.
Given an unsorted array of integers, find the smallest number in the array, the largest number in the array, and the smallest number between the two array bounds that is not in the array.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def min_min_max(array) | |
| (array.minmax << ((array.min..array.max).to_a - array).min).sort | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment