Auto-complete upto longest common prefix