Next immediate greatest number which has all the digits

Given a integer, find the next immediate greatest number which has all the digits in the given number public class Answer implements NextLargeNumberInterface { @Override public int GetNextLargeNumber(int num) { // WRITE YOUR CODE HERE return ; } public static void main(String [] args) { // write code here to test } } Example1: Input: 2586 Output:2658 Example2: Input: 469 Output:496

Answer

No comments:

Post a Comment