I have a problem like in tittle, i want to make loop for for array with odd elements,

Ex. [ 5 , 5 , 3 , 7] in this way program will take 5+5 for left sum (array.lenght /2) and 3+7 for right sum. After all i want to compare them.

Problem is when the array looks like [ 5 , 5 , 3 ] in that way i cannot make array.lenght/2

And the question is what can i do?

```
    int rightSum = 0;
    int leftSum = 0;

    for (int i = 0; i < array.length / 2; i++) {
        leftSum += array[i];
    }
    if (array.length % 2 == 0) {
        for (int i = array.length / 2; i < array.length; i++) {
            rightSum += array[i];
        }
    } else {

    }

    return leftSum == rightSum;
}

```