Tap here to switch tabs
Problem
Submissions

Problem: Smallest Value of the Rearranged Number

Try to solve the Smallest Value of the Rearranged Number problem.

Statement

You are given an integer num. Rearrange the digits of num such that its numerical value is minimized.

The rearranged integer must not contain any leading zeros, unless num itself is equal to 00.

Return the rearranged integer with the smallest value.

Constraints:

  • −1015≤-10^{15} \leq num ≤1015\leq 10^{15}

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Smallest Value of the Rearranged Number

Try to solve the Smallest Value of the Rearranged Number problem.

Statement

You are given an integer num. Rearrange the digits of num such that its numerical value is minimized.

The rearranged integer must not contain any leading zeros, unless num itself is equal to 00.

Return the rearranged integer with the smallest value.

Constraints:

  • −1015≤-10^{15} \leq num ≤1015\leq 10^{15}