Create the longest common prefix with the direct neighbour
Solution Breakdown
Assume that the longest prefix is the first word of the dataset
Compare that second word in the list with the current long prefix and create a new longest prefix possible
Do this with each subsequent neighbours
At any point the longest prefix is empty, return empty string
If there are no more neighbours, return the prefix
Example of looking at differences
explanation
Pseudocode
Python Solution
Code Explanation
asd
Connected Readings
Last updated