Domanda di colloquio di Xoriant

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