given number A, find a number B which is bigger than that by using same digits available in the number A
You have given a positive number. You have to find a number which is immediate bigger than that by using same digits available in the number.

use same digits with same number of time, coming in positive integer and if a small number is not possible then we have to return -1.

For example:
(1) You have given a number 7585 , your output should be 7855 .
(2) 7111, return -1.

Thanks,

Zhong
given number A, find a number B which is bigger than that by using same digits available in the number A
===

You have given a positive number. You have to find a number which is immediate bigger than that by using same digits available in the number.

use same digits with same number of time, coming in positive integer and if a small number is not possible then we have to return -1.

For example:
(1) You have given a number 7585 , your output should be 7855 .
(2) 7111, return -1.

Thanks,

Zhong