Initial implementation for Twitter's puddle calculator interview question