PasteRack.org
Paste # 49796
2024-11-30 05:52:32

Fork as a new paste.

Paste viewed 202 times.


Embed:

  1. #lang racket
  2.  
  3. (define (last2 lista)
  4. (let ((reverselist (reverse lista)))
  5. (cond
  6. ((null? reverselist) '())
  7. ((<= (length reverselist) 2) lista)
  8. (else (list (second reverselist) (first reverselist))))))

=>