4 ms·
Also, they don't need to come up with an algorithm: to solve the problem, you simply need to implement exactly what's written in the problem statement - calcula
by jlangenauer 14y ago
Also, they don't need to come up with an algorithm: to solve the problem, you simply need to implement exactly what's written in the problem statement - calculating each element based on the previous row, and with a couple of conditional statements (or other ways) to handle the edge cases at the, er, edge of each row. There is a bit of a conceptual leap in working out a recursive solution is possible (as is an iterative one), so I'll sometimes gently drop hints if a candidate seems to be struggling on this point.