740 repaired the solution by William Eastwood

The solution