complexity problem

complexity problem