Question d’entretien chez Meta

Given an array , I had select an subarray which summation is equal to a pre supplied number.

Réponse à la question d'entretien

Utilisateur anonyme

22 janv. 2022

Start with i,j at 0 and current sum at num[0], if the sum is less than target, move j by 1 and add to sum, when the sum is greater, move i by 1 and remove it from the sum.