One solution can be to linearly traverse the entire array and find the missing number. Here time complexity is O(n).
We can get this in O(Logn) time using the modification of the Binary Search algorithm
We can get the middle element and find if it lies in between before mid or the after mid. This way we are reducing the size of our array to half everytime and hence the answer is O(Logn)