Question: 
Write a function to find the longest common prefix in the given set of strings.


Model's Code:
def common_prefix(strings, length):
    if not strings:
        return ''
    prefix = ''
    for i in range(length):
        current_char = strings[0][i]
        for string in strings:
            if i >= len(string) or string[i] != current_char:
                return prefix
        prefix += current_char
    return prefix



Sample Correct Code:
def common_prefix_util(str1, str2): 
	result = ""; 
	n1 = len(str1) 
	n2 = len(str2) 
	i = 0
	j = 0
	while i <= n1 - 1 and j <= n2 - 1: 
		if (str1[i] != str2[j]): 
			break
		result += str1[i] 
		i += 1
		j += 1
	return (result) 
def common_prefix (arr, n): 
	prefix = arr[0] 
	for i in range (1, n): 
		prefix = common_prefix_util(prefix, arr[i]) 
	return (prefix) 


Asserts:
assert common_prefix(["tablets", "tables", "taxi", "tamarind"], 4) == 'ta'
assert common_prefix(["apples", "ape", "april"], 3) == 'ap'
assert common_prefix(["teens", "teenager", "teenmar"], 3) == 'teen'


Tests:
Test 1 of 3: PASS
Test 2 of 3: PASS
Test 3 of 3: FAIL: AssertionError()

Test 181 of 974: 133/181 (73.48066298342542%): failed