Question d’entretien chez Internshala

given an array and a number, find a cont sub-array whose sum equals to that given number.

Réponse à la question d'entretien

Utilisateur anonyme

13 août 2020

Use sliding window and add elements from the starting index. If the sum of the subarray is greater than the required sum, start removing elements from the beginning of the subarray. In this way traverse the entire subarray until you find the answer.