How is this O(n)?

Using Hashing finding a pair in the array (of length n) having a given sum has time complexity of:

O(1)

O(N)

O(N^2)

O(logN)

using hashing we can find it in constant time.
try to select 0(1).
Happy Learning !!

the answer is given as O(n)

hey @haseebshaik00 we have to find the sum i didnt read that completely because we have to then iterate over the whole array.
thats why it is O(N).

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.