def lc_prefix(prefix, s):
  """return the longest common prefix of prefix and s"""
  if prefix is None:
    return s
  n = 0
  for i, j in zip(prefix, s):
    if i != j:
      break
    n += 1
  return prefix[:n]