This is what I came up with. I haven't found a problem with it, maybe you guys can.


int maxConsecutiveNumbers(int length, int a[]) {

int currentMax = 0;
int leftSide = 0;

...