I am given a supposedly consecutive array such as this:
{4,5,7,8,9,10} // missing 6
And I am supposed to efficiently find the missing 6.
I have thought of doing a binary search, and checking the mid +1, mid -1.
But I keep thinking there would be so many base cases. I keep failing...
This shouldn't be such a hard problem but I do not know why I am struggling so hard :/
Could someone guide me through this one??
Thanks so much guyz