Skylads interview question

standard programming exercises