added solutionfor allStar problem