Created
December 26, 2019 19:02
-
-
Save venelrene/de418c5f8c5d4fc3e9179e8ed27a4905 to your computer and use it in GitHub Desktop.
Write a method that takes an array of consecutive (increasing) letters as input and that returns the missing letter in the array. You will always get an valid array. And it will be always exactly one letter be missing. The length of the array will always be at least 2. The array will always contain letters in only one case. Example: ['a','b','c'…
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 find_missing_letter(arr) | |
| (arr = (arr.min..arr.max).to_a - arr).first | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment