flower problem - solution