solution for competition1