Programming Solution

Programming solution with test data.