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

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

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

Post 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)
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply