Jump to content

Maximum triangle path sum: Difference between revisions

m
m (→‎{{header|Wren}}: Changed to Wren S/H)
imported>Arakov
Line 1,448:
int i := 0;
int j := 0;
input.splitBy(newLineConstant).forEach::(string line)
{
j := 0;
line.trim().splitBy(" ").forEach::(string num)
{
list[i][j] := num.toInt();
Line 1,461:
};
for(int i := 16,; i >= 0,; i-=1)
{
for(int j := 0,; j < 18,; j += 1)
{
list[i][j] := max(list[i][j] + list[i+1][j], list[i][j] + list[i+1][j+1])
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.