Problem 3 - slow attempt

Attempt at problem 3 which is correct, but runs too slowly