You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given a string representing an integer number num, find the next number greater than num using the same set of digits. If there is no greater number with the same set of digits possible, then print -1.
For example, if num = 1234, then the answer is 1243.