This file contains 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
(ns decaddance.core | |
(:require [clojure.math.numeric-tower :as math] | |
[clojure.set :as set]) | |
(:use [midje.sweet] | |
[clojure.core.match :only [match]] | |
) | |
) | |
(def origin [0 0]) |
This file contains 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
function mySolution(walls){ | |
var heightLoc = {}; | |
var waterSum = 0; | |
for(var x=0; x<walls.length; x++){ | |
for(var y=0; y<walls[x]; y++){ | |
var height = y+''; | |
waterSum += height in heightLoc ? (x - heightLoc[height]) - 1 : 0; | |
heightLoc[height] = x; // record last time we saw a wall of this height | |
} | |
} |
This file contains 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
;; gorilla-repl.fileformat = 1 | |
;; ** | |
;;; # Coin Board Game or Die | |
;;; From the puzzle found here: http://fivethirtyeight.com/features/can-you-survive-this-deadly-board-game/ | |
;;; | |
;; ** | |
;; @@ | |
; namespace and includes... |
This file contains 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
const s3PutLambdaRole = new iam.Role(this, "S3PutLambdaRole", { | |
assumedBy: new iam.ServicePrincipal("lambda.amazonaws.com") | |
// managedPolicyArns: | |
}); | |
bucket.grantRead(s3PutLambdaRole); | |
const s3EventLambda = new lambda.Function(this, "s3PutHandler", { | |
runtime: lambda.Runtime.NodeJS810, | |
code: lambda.Code.directory("resources"), |