Let's implement his favourite expression:
Given a row of Pascal's triangle, compute the next row.
This can for example be computed by taking the input padded with a zero on the left, and the input padded with a zero on the right, and then adding the two element-by-element.
Test cases
[1]
→ [1,1]
[1,1]
→ [1,2,1]
[1,2,1]
→ [1,3,3,1]
[1,10,45,120,210,252,210,120,45,10,1]
→ [1,11,55,165,330,462,462,330,165,55,11,1]
[1,50,1225,19600,230300,2118760,15890700,99884400,536878650,2505433700,10272278170,37353738800,121399651100,354860518600,937845656300,2250829575120,4923689695575,9847379391150,18053528883775,30405943383200,47129212243960,67327446062800,88749815264600,108043253365600,121548660036300,126410606437752,121548660036300,108043253365600,88749815264600,67327446062800,47129212243960,30405943383200,18053528883775,9847379391150,4923689695575,2250829575120,937845656300,354860518600,121399651100,37353738800,10272278170,2505433700,536878650,99884400,15890700,2118760,230300,19600,1225,50,1]
→ [1,51,1275,20825,249900,2349060,18009460,115775100,636763050,3042312350,12777711870,47626016970,158753389900,476260169700,1292706174900,3188675231420,7174519270695,14771069086725,27900908274925,48459472266975,77535155627160,114456658306760,156077261327400,196793068630200,229591913401900,247959266474052,247959266474052,229591913401900,196793068630200,156077261327400,114456658306760,77535155627160,48459472266975,27900908274925,14771069086725,7174519270695,3188675231420,1292706174900,476260169700,158753389900,47626016970,12777711870,3042312350,636763050,115775100,18009460,2349060,249900,20825,1275,51,1]