Advanced Algorithm Q.11