Find Unique Values

Problem Overview

  • Pair developers by repeatedly matching the lowest and highest experience and compute each pair’s average; count unique average values.
  • Input: integer array experience[n]; Output: integer count of distinct averages.
  • Constraints: n is even, 1 ≤ n ≤ 1e5, experience values in [1, 1e9].
  • Real-world context: pairing Amazon developers for a hackathon based on experience.
  • From Amazon interviews; a coding interview problem and interview question focused on arrays and pairing.

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: