Hacker News new | past | comments | ask | show | jobs | submit login

I don't understand why are people having troubles interpreting the text.

P(i,j) = the number at i-th row and j-th column, could be defined as:

P(i, j) = P(i-1, j-1) + P(i-1, j+1) - for the indented pyramid diagram

or

P(i, j) = P(i-1, j-1) + P(i-1, j) - for the non indented triangle (the way it would appear in a basic 2D data structure, eg: int P[][]).

Also, you will have to check if P(i-1,j-1) exists.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: