Pascal's Triangle

Submitted By:
david

Difficulty:
Medium

Tags:
math, arithmetic

Instructions:
Write a method that will return the nth row of Pascal's Triangle. For more information on Pascal's Triangle, see http://en.wikipedia.org/wiki/Pascal%27s_triangle.

Hidden Code:
There is hidden code with assertions that is also being run to test out your code.

Code:
___

assert_equal pt(0), [1]
assert_equal pt(1), [1, 1]
assert_equal pt(2), [1, 2, 1]
assert_equal pt(3), [1, 3, 3, 1]
assert_equal pt(4), [1, 4, 6, 4, 1]

Your Solution

Ruby 1.9.3

Back to Problems