My solution to the coding exercise issued by Amazon's intern recruitment.