```python
def common_prefix_util(str1, str2):
    """
    A utility function to find the common prefix between two strings.
    """
    result = []
    i, j = 0, 0
    while i < len(str1) and j < len(str2):
        if str1[i] == str2[j]:
            result.append(str1[i])
            i += 1
            j += 1
        else:
            break
    return "".join(result)

# The problem description is slightly ambiguous. It asks for a function
# to find the LCP of a "set of strings" but provides a signature for two strings.
# The following function would solve the general problem, using the utility function above.
# However, the tests require only the `common_prefix_util` function.

def longest_common_prefix(strs):
    """
    Finds the longest common prefix string amongst an array of strings.
    """
    if not strs:
        return ""
    
    prefix = strs[0]
    for i in range(1, len(strs)):
        prefix = common_prefix_util(prefix, strs[i])
        if not prefix:
            break
    return prefix

```