add pascal triangle problem

I saw a page on facebook posting this so i tried myself.
It used dynamic programming.