We need to maintain mobileNumber and its location in memory. The challenge is that we have more than 5 million of users and storing the location for each user will be like
First of all range = [begin;end;location]
range
begin
end
location
Use two structures:
Apply following algo: