Longest Common Pattern - lisp