Compute maximum later-earlier difference | Citadel Interview Question