Add solution 2.40(bug fixed)
Add solution to 2.40(bug fixed)