Company: Headout_12sep
Difficulty: medium
Movie Night Pairing Problem Description Emma and her friends are planning a movie night. They have a list of N movies, each with a different duration in minutes. The group wants to watch as many pairs of movies as possible without exceeding the total available time T minutes. A pair consists of two different movies, and their total duration must be less than or equal to the available time T. Your task is to find the maximum number of such pairs. Function Description You must implement the function movie_pairs . This function determines the maximum number of movie pairs that can be watched, ensuring that no pair exceeds the given total time T. Parameters N (int) – The number of movies. T (int) – The maximum allowed time for any movie pair. duration (int[]) – An array of N integers, where each integer represents the duration of a movie in minutes. Returns An integer representing the maximum number of valid movie pairs. Input Format The first line contains an integer N – the number of mov