Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Ask HN: Am I being too hard on the developers I interview?. Parent comment
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.
There are no comments on this comment yet.
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.