Project Euler 11 - Largest product in a grid
Project Euler 11 - Largest product in a grid
Official link: https://projecteuler.net/problem=11
Thought Process
Thought Process
I made 5 functions
horizontalsum()
Goes through the grid and takes the product of 4 horizontal numbers, outputs the maximum product
verticalsum()
Goes through the grid and takes the product of 4 vertical numbers, outputs the maximum product
stairsumtotheright()
Goes through the grid and takes the product of 4 diagonal numbers going from left to right, outputs the maximum product
stairsumtotheleft()
Goes through the grid and takes the product of 4 diagonal numbers going from right to left, outputs the maximum product
Outputs the maximum of these 4 functions
Interactive Code
Interactive Code
Input an integer (yourinput)
Code will output greatest product of yourinput adjacent numbers