Solution 1 - Brute Force
Iterate through every pair of numbers using two nested loops. For each pair, check if they sum to the target. Return the indices when a match is found.
Solution 2 - Brute Force using enumerate()
Same brute force logic, but uses Python's enumerate() for cleaner index tracking instead of range(len(...)).
Solution 1 - Simple Math Approach
Given an array of unique integers representing salaries, calculate the average after excluding the minimum and maximum values. Sum all salaries, subtract the min and max, then divide by n - 2.
Solution 2 - Single Pass with Tracking
Traverse the array once, keeping track of the running sum, minimum, and maximum. After the loop, subtract the min and max from the total sum and divide by n - 2. This avoids multiple passes over the array.
Solution 3 - Sort and Slice
Sort the array, then take the average of all elements except the first and last. This approach is simple and readable, though sorting adds an O(n log n) overhead.