Added solution to 317 as 318.