Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
(3..gets.to_i - 1).to_a.inject([0, 0, 1]) {|tri, a| tri << tri[tri.size - 1] + tri[tri.size - 2] + tri[tri.size - 3]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment