given an unsigned char array, find if there is a subarray whose elements sum up to a given value
Réponses aux questions d'entretien
Utilisateur anonyme
24 sept. 2013
Total wrong answer. You are not finding the subarray at all. Must use recurison for simplified version
Utilisateur anonyme
19 mai 2013
bug -
J < array.length-i
otherwise you go out of the array boundaries
Utilisateur anonyme
29 avr. 2013
public static bool SubArraySum(int[] array, int sum)
{
int tempsum = 0;
for(int i = 0; i sum)
{
tempsum = 0;
break;
}
}
}
return false;
}
(Note: this function operates on int instead of char)