Equalize Team Size

Problem Overview

  • Given n teams with sizes teamSize[i], you may reduce the size of at most k teams; determine the maximum number of teams that can have the same size after reductions.
  • Input: array teamSize and integer k. Output: an integer for the largest count of equal-size teams. Constraints: 1≤n≤2e5, 1≤teamSize[i]≤1e9, 0≤k≤1e9.
  • Context: HackerRank hackathon aiming for uniform team sizes; only reductions are allowed.
  • From Ibm interviews; a coding interview problem and interview question on team size equalization.

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: