The Longest Common Prefix problem is a classic string manipulation challenge that tests your ability to identify shared patterns among strings.
Given an array of strings strs, return the longest common prefix among all strings in the array.
We'll take a horizontal scanning approach, where we iteratively compare the prefix of one string with the next string, updating the common prefix as we go.
The time complexity of the solution is O(S), where S is the sum of all characters in the array.