Pergunta de entrevista da empresa Xoriant

longest substring which is common input - ['abcd', 'abc','abef'] output = ab