CMD:
go run main.go R1C4 R1C6 R2C3 R2C7 R3C9 R3C10
then enter the number of seats you want to reserve
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package merkletree | |
import ( | |
"bytes" | |
"crypto/sha256" | |
"errors" | |
"fmt" | |
) | |
//Content represents the data that is stored and verified by the tree. A type that |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func hourglassSum(arr [][]int32) int32 { | |
var maxVal int32 = -63 | |
for i, j := 0, 0; i < len(arr) - 2; j++ { | |
tr := arr[i][j] + arr[i][j+1] + arr[i][j+2] | |
mr := arr[i+1][j+1] | |
br := arr[i+2][j] + arr[i+2][j+1] + arr[i+2][j+2] | |
total := tr + mr + br | |
if total > maxVal { | |
maxVal = total | |
} |
OlderNewer