def common_prefix_util(str1, str2):
    limit = min(len(str1), len(str2))
    index = 0

    while index < limit and str1[index] == str2[index]:
        index += 1

    return str1[:index]