Skip to content

Instantly share code, notes, and snippets.

@hooptie45
Created April 2, 2014 06:01
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 hooptie45/9928689 to your computer and use it in GitHub Desktop.
Save hooptie45/9928689 to your computer and use it in GitHub Desktop.
def rows(hash, counts, stack, depth)
r = Array(hash[:rows])
counts[stack[depth]] = r.length
counts[stack[depth + 1]] = r.reduce(0) {|m,r| m += rows(r, counts, stack, depth + 1) }
Array(r).length
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment