and my solutions (still incomplete): http://www.informatimago.com/develop/lisp/l99/index.html
Pascal J. Bourguignon wrote:(partition-by identity)
and my solutions (still incomplete):
http://www.informatimago.com/develop/lisp/l99/index.html
Where we find:
(---------------------------------------------------------------
P13 (**) Run-length encoding of a list (direct solution).
Example:
* (encode-direct '(a a a a b c c a a d e e e e))
((4 A) B (2 C) (2 A) D (4 E))
"
(flow '(a a a a b c c a a d e e e e)
(flow '(a a a a b c c a a d e e e e)(partition-by identity)
(flow '(a a a a b c c a a d e e e e)(partition-by identity)
;; Iterative solution, uses only O(r) space:
| Sysop: | Amessyroom |
|---|---|
| Location: | Fayetteville, NC |
| Users: | 65 |
| Nodes: | 6 (0 / 6) |
| Uptime: | 05:23:36 |
| Calls: | 862 |
| Files: | 1,311 |
| D/L today: |
921 files (14,318M bytes) |
| Messages: | 264,603 |