SOLVED: Problem 49
ADDED: Test case for problem 49
ADDED: Comments and Formatting.