Skip to content

Instantly share code, notes, and snippets.

@aalvarado
Created March 10, 2015 13:41
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 aalvarado/104ce92e4d3660c12a04 to your computer and use it in GitHub Desktop.
Save aalvarado/104ce92e4d3660c12a04 to your computer and use it in GitHub Desktop.
PermMissingElem
def solution(a)
((( a.size + 2 ) * ( a.size + 1 )) / 2) - ( a.reduce(&:+) || 0 )
end
@aalvarado
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment