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
// Optimizing Javascript Implementation of Goats, Wolves and Lions | |
// Original fun puzzle from http://unriskinsight.blogspot.com/2014/06/fast-functional-goats-lions-and-wolves.html | |
// | |
// Strategy: | |
// 1 - we know that each move reduces the total population by 1, so the optimal | |
// solution will be the one with the least moves. So we'll progressively | |
// explore solutions of greater depth until we find a stable forest. | |
// 2 - since each move removes at most one from each animal, any solution | |
// must have a depth at least as great as the minimum of the initial animal counts. | |
// 3 - the order of moves doesn't matter. to be more precise, if there is |
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
namespace NewCo.TwitterAnalysis.Idiomatic | |
open System | |
type tweet = DateTime * int * string | |
type stockVolume = DateTime * int | |
type tweetProvider = string -> tweet seq | |
type stockVolumeProvider = string -> stockVolume seq |