twitter interview solution implemented in golang