Mike and HashTrick problem TLE

Only one test case is passing and rest are showing TLE. Please help.