Loading...
Given an array of strings, find the longest common prefix among all strings. If none, return "".
flower,flow,flight
fl
flower, flow, and flight.f is common to all strings, so it is added to the prefix.l is also common to all strings, so it is added to the prefix, resulting in fl.o in flower and flow, i in flight), the comparison stops, and the common prefix fl is returned as the output.