You are viewing a single comment's thread. Return to all comments →
Hi! How can you do this without initializing the array?
I tried your way but it keeps not working. So I tried
static int simpleArraySum(int[] ar) {
int n = 1; int[] arrayFdp = new int [n]; int soma = 0; for (int i = 0; i < arrayFdp.Length; i++) { soma = soma + arrayFdp[i]; }
return soma; }
and it does't pass all the sample testcases! What am I doing wrong? Thanks
Seems like cookies are disabled on this browser, please enable them to open this website
Simple Array Sum
You are viewing a single comment's thread. Return to all comments →
Hi! How can you do this without initializing the array?
I tried your way but it keeps not working. So I tried
static int simpleArraySum(int[] ar) {
return soma; }