Compress the Digits

Write a function compress(n)compress(n) that, given a positive integer nn, returns the number obtained by deleting from nn 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 & José Luis Balcázar

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

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