Solution for test given by sturents.com