Bitmorpher interview question

Basic data structure and simple code