Skip to content

Instantly share code, notes, and snippets.

View squiidz's full-sized avatar

JChaput squiidz

  • Joliette
View GitHub Profile
@squiidz
squiidz / merkletree.go
Created May 28, 2019 20:08
MerkleTree
package merkletree
import (
"bytes"
"crypto/sha256"
"errors"
"fmt"
)
//Content represents the data that is stored and verified by the tree. A type that
@squiidz
squiidz / hourglass.go
Created November 15, 2019 20:07
hourglass O(n)
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
}
@squiidz
squiidz / README.md
Last active March 3, 2021 12:57
Seats assignment

CMD: go run main.go R1C4 R1C6 R2C3 R2C7 R3C9 R3C10 then enter the number of seats you want to reserve