[ ASSIGNMENT: ] Next smaller number with the same digits
TASK : Write a function that takes a positive integer and returns the next smaller positive integer containing the same digits. Input >> Output Examples :: nextSmaller(21) --> return 12 nextSmaller(531) --> return 513 nextSmaller(2071) --> return 2017 Return -1, when there is no smaller number that contains the same digits. Also return -1 when the next smaller number with the same digits would require the leading digit to be zero. nextSmaller(9) --> return -1 nextSmaller(111) --> return -1 nextSmaller(135) --> return -1 nextSmaller(1027) --> return -1 // 0721 is out since we don't write numbers with leading zeros NOTE: - Some tests will include very large numbers! - Test data only employs positive integers! HappyCodings!:) https://code.sololearn.com/Wx9Cg9Nq1zbu/?ref=app thisOne is for --> VcC !!:)