Would love to know the best solution, algorithm and data structure wise for this:
Given places (A list of dict):
[{"place":"Australia"},
{"place":"New Zealand"},
{"place":"New Guinea"},
{"place":"New York"},
{"place":"Yorkshire"},
{"place":"New Brunswick"}]
and given a prefix, find all results that contains that prefix. Limit results to 3 places
Example: prefix: "york"
result = ["New York","Yorkshire"]
ps: Had the place "New York" been written as "NewYork" , the result set would only return ["Yorkshire"]