Full thread4ydx·Here is my go at #4. It took me more time than I would like to admit :)http://play.golang.org/p/CTZahLt7g1View on HN