Get Maximum Efficiency

Problem Overview

  • Choose times t1 and t2 to maximize efficiency: tests in [t1, t2] inclusive minus (t2 - t1), with at least two tests executed.
  • Input: int array arrivalTime[n]; Output: int maximum efficiency; constraints: 2 ≤ n ≤ 2e5, 1 ≤ arrivalTime[i] ≤ 1e9.
  • Context: ML testing window; simultaneous arrivals allowed; execution is instantaneous; result can be negative.
  • Expedia coding interview problem and interview question from Expedia interviews.

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Input Variables
Execution Result: