Prob 5 in C. This one was easy to implement.. but it was brute force.