It is important to consider edge cases.
- Is the array guaranteed to contain at least one element? If it can be empty, be sure that this will not cause your function to fail.
- Also make sure that the function can handle an array that contains only zeroes.