Compress the Digits

Write a function compress(n) that, given a positive integer n, returns
the number obtained by deleting from n all digits (non-negative integers
less than 10) that repeat the digit at their left.

Observation

All integers are assumed written in the usual base 10.

Problem information

Author: Jordi Delgado &amp; José Luis Balcázar

Generation: 2026-01-25T16:15:11.643Z

© Jutge.org, 2006–2026.
https://jutge.org
