1. Auto Complete - rolling-scopes-school/RS-Short-Track GitHub Wiki
Folder Name | Branch | Coefficient |
---|---|---|
auto-complete | auto-complete | 0.4 |
Your task is to implement a custom createAutoComplete
function and implement the fastest algorithm.
The function should get an array of strings as input and work as in the example below:
const data = [
'java',
'javascript',
'python',
];
const autocomplete = createAutoComplete(data);
autocomplete('ja'); // returns [ 'java', 'javascript']
autocomplete('javas'); // returns [ 'javascript']
autocomplete('p'); // returns [ 'python']
Please note that your index file should contain one export createAutocomplete
.
You can find test and examples here.
Please run tests with your code before submitting PR, your mark depends on it.