Coding | Practice Questions Daily | C | C++ | Python | Java: post #104 — TG.ME

Next Greater Number with Same Set of Digits Given a number n, find the smallest number that has same set of digits as n and is greater than n. If n is the greatest possible number with its set of digits, then print “not possible”. Examples: (For simplicity of implementation, we have considered input number as a string.) Input: n = "1234" Output: "1243" Input: n = "4321" Output: "Not Possible" Input: n = "534976" Output: "536479" Topic : Arrays Asked in Flipkart References -> https://www.geeksforgeeks.org/find-next-greater-number-set-digits/ https://www.geeksforgeeks.org/flipkart-interview-experience-sde-2/ Join our Official Channel https://t.me/coding_practice_questions

GeeksforGeeksFind next greater number with same set of digits - GeeksforGeeksYour All-in-One Learning Portal: GeeksforGeeks is a comprehensive educational platform that empowers learners across domains-spanning computer science and programming, school educa…
July 24, 2021 28K 7 36