Rearranging Digits
Start Timer
0:00:00
Given a string n
, a multi-digit number, write a function rearranging_digits
to return a string of the smallest number larger than n
that can be created by rearranging the digits in n
. Return None
if no such number exists.
Example:
Input:
n = '395'
Output:
def rearranging_digits(n) -> '539'
Recommended questions for you
Personalized based on your user activity, skill level, and preferences.
.
.
.
.
.
.
.
.
.
Comments