Maximum Difference with Order

Company: opentext_16oct

Difficulty: medium