I am not getting what we have to do in this question

Please give me some hints so that i can solve this question

in this question you have given a hash function which give you a integer corresponding to an array
using its algorithm mentioned in question

but the problem is it’s algorithm has high time complexity

now you have to code a algorithm with less time complexity
first observe the pattern and then code the algorithm

for reference purpose you can take help from code below

Reference Code

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.