Problem Statement
Write a function to find the longest common prefix string amongst an array of strings. If there is no common prefix, return an empty string "".
Approach
Take the first string as the prefix. Compare it with the second, trimming the prefix from the end until it matches. Repeat for all strings.
Time & Space Complexity
Time complexity is O(S), where S is the sum of all characters in all strings. Space complexity is O(1).
