-- Assumes symmetric grid. Left-to-right diagonal
diagonalsLRMax n grid = let maxX = (length (head grid)) - n
                            maxY = (length grid) - n
                            startPositions = [(x, y) | x <- [0..maxX], y <- [0..maxY]]
                      in maximum $ map (\(x,y) -> product (diagonal n grid x y)) startPositions
diagonalsLRMax n grid = let maxX = (length (head grid)) - n
                            maxY = (length grid) - n
                            startPositions = [(x, y) | x <- [0..maxX], y <- [0..maxY]]
                      in maximum $ map (\(x,y) -> product (diagonal n grid x y)) startPositions
diagonalsLRMax n grid = let maxX = (length (head grid)) - n
                            maxY = (length grid) - n
                            startPositions = [(x, y) | x <- [0..maxX], y <- [0..maxY]]
                      in maximum $ map (\(x,y) -> product (diagonal n grid x y)) startPositions