CAPILLARY TECHNOLOGIES | Smallest Value of the Rearranged Number | On-Campus OA (2023)
Question · Posted Jun 2026
Problem Statement You are given a non-zero integer num. Your task is to rearrange its digits such that the resulting number is the smallest possible value while preserving the sign of the original number. Rules If num is positive, rearrange digits to obtain the smallest positive number. If num is negative, rearrange digits to obtain the smallest negative number (i.e., the largest magnitude negative value). Leading zeros are not allowed. The sign of the number must remain unchanged. Return the ...
The full answer & interview discussion are available to premium members.
Log in Create a free account