Skip to content

Instantly share code, notes, and snippets.

@venelrene
Created December 26, 2019 19:02
Show Gist options
  • Select an option

  • Save venelrene/de418c5f8c5d4fc3e9179e8ed27a4905 to your computer and use it in GitHub Desktop.

Select an option

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'…
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