Given an array of numbers arr and a number S, find 4 different numbers in arr that sum up to S.
Write a function that gets arr and S and returns an array with 4 indices of such numbers in arr, or null if no such combination exists. Explain and code the most efficient solution possible, and analyze its runtime and space complexity.
example:
|