How to verify error in my hash function ?

binary-search
hashing

#1

I was solving this problem link text
and my solution is link text

I solved this using hashing and binary search technique , but it shows WA .
Not sure what is the problem with my hash function , Can anyone plz help me in this ?


#2

Found the solution using double hashing
solution