Created
April 2, 2014 06:01
-
-
Save hooptie45/9928689 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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