RetailMeNot Interview Question

Simple question involving sorting a list and summing it to a certain point.