Page 1 of 1

Create a LISP function named adjacentSequence that takes a list and returns the list with all the same elements next to

Posted: Fri May 20, 2022 1:30 pm
by answerhappygod
Create a LISP function named adjacentSequence that takes a list
and returns the list with all the same elements next to each
other.
For example: adjacentSequence '(c b c d e) returns (C C B D
E)
Second example: (12 13 14 12 18) returns (12 12 13 14 18)
Third example: (a b c a c e f b a g e) returns (A A
A B B C C E E F G)