The above question will be solved in O(n) time since our input is not sorted.
Apply linear search, So, O(n).
If the input would have been in sorted order we could have just applied Binary Search on index and got the answer in O(log n) time.
I hope it helps :)