Skip to content

Instantly share code, notes, and snippets.

@dubistdu
Created November 21, 2019 14:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dubistdu/ab6d2a6cdc2ceea4f5da2cbf569d1eeb to your computer and use it in GitHub Desktop.
Save dubistdu/ab6d2a6cdc2ceea4f5da2cbf569d1eeb to your computer and use it in GitHub Desktop.
def min_min_max(array)
sorted = array.sort
sorted_all=[*sorted.first..sorted.last]
[sorted.first, (sorted_all-sorted).min, sorted.last]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment