added tests
passed basic tests
applied discounts greedily (passed simple discount tests)
applied discount optimization to pass the edge cases