Eternus Solutions interview question

Programming for prymid pattern