Added solution for PE problem 39 with a 3ms runtime