Company: Tekion_SDE intern_On-campus_3july
Difficulty: medium
TechFest is a large annual college festival that attracts thousands of participants from across the country. The organizing committee has arranged accommodation for the outstation participants in the college hostel. There are n participants who have requested a room and m rooms available in the hostel. Each participant has submitted their preferred room area. A participant will be comfortable in a room if its area differs from their preference by at most d square feet. Each room can be assigned to at most one participant, and each participant can receive at most one room. Your task is to find the maximum number of participants that can be assigned a room they are comfortable in. Function Description Complete the function maxParticipantsAssigned. The function should return the maximum number of participants who can be assigned a comfortable room. Function Parameters int n — number of participants int m — number of available rooms int d — maximum allowed difference int[] preferred — pref