Plaster

common-lisp
(defun strip-trailing-0s (sequence) "Removes only 0's on the end of a sequence, it will skip 0's in the middle and returns a new sequence" (loop :for x :across (reverse sequence) :for i :downfrom (length sequence) :to 0 :unless (zerop x) :return (subseq sequence 0 i)))