executeSubmarineCommands2 = input => parseSubmarineCommands(input)
.reduce(([curX, curY, aim], [dir, amt]) => {
if (dir === 'forward') return [curX + amt, curY + aim * amt, aim]
if (dir === 'down') return [curX, curY, aim + amt]
if (dir === 'up') return [curX, curY, aim - amt]
}, [0, 0, 0])