Project Euler 11 - Largest product in a grid

Official link: https://projecteuler.net/problem=11

Thought Process

I made 5 functions

  1. horizontalsum()

    • Goes through the grid and takes the product of 4 horizontal numbers, outputs the maximum product

  2. verticalsum()

    • Goes through the grid and takes the product of 4 vertical numbers, outputs the maximum product

  3. stairsumtotheright()

    • Goes through the grid and takes the product of 4 diagonal numbers going from left to right, outputs the maximum product

  4. 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

Input an integer (yourinput)

Code will output greatest product of yourinput adjacent numbers