Festival Team Problem
Festival Team Problem — ExecCode Medium DSA Practice
Solve the Festival Team problem on ExecCode. Free online medium DSA practice in Two Pointers. Write and run code in Java, C++, Python — no signup required to run.
Problem description
Each student has a skill value. A team is balanced when the difference between its highest and lowest skill is at most K. Choose one group of students that forms a single balanced team. Return the maximum number of students that can be included. Return the largest balanced team size. You are given: skill — skill k — k Return the largest balanced team size. Copied from OA Lab Part 1.
Examples
Input {'skill': [4, 1, 7, 3, 5, 2], 'k': 3}; Output 4. Input {'skill': [1, 2, 3, 4, 5], 'k': 0}; Output 1. Input {'skill': [1, 1, 1, 1, 1], 'k': 0}; Output 5
Constraints
Follow the statement. Use a 64-bit integer when values can overflow.
Practice Festival Team free on ExecCode. Browse DSA problems, topic map, and placement guides.