← Questions

Smallest larger number that shares no digit with n

0
ElevenLabsCodingLast asked Sep 2026

Given a positive integer n, return the smallest integer greater than n that contains none of the digits that appear in n, or -1 if there is none. Build the answer digit by digit rather than counting upward.

Write and test your solution herePython in your browser, the question's tests level by level, saved for you.Sign in to start coding