← Questions
Shell tab completion for file paths
0
I was asked this
No reports yet. Sign in to say where you were asked it.
Implement what a shell does when you press Tab. You get the absolute paths of all files, the current directory and the text typed so far. Resolve the typed text against the current directory unless it starts with /. If files start with that prefix, complete to the longest prefix they all share (which may run through several directory names); otherwise return the prefix unchanged. Discuss a trie for repeated completions over a large file tree.
No official answer yet. Write yours on the right and run it.
Nothing published yet.
Sign in to submit your code; every attempt is kept here.
Write and test your solution herePython in your browser, the question's tests level by level, every submission kept for you.Sign in to start coding
