Horje
find next greater number with same digits Code Example
find next greater number with same digits
def findnext(ii):
    iis=list(map(int,str(ii)))
    for i in reversed(range(len(iis))):
        if i == 0: return ii
        if iis[i] > iis[i-1] :
            break        
    left,right=iis[:i],iis[i:]
    for k in reversed(range(len(right))):
        if right[k]>left[-1]:
           right[k],left[-1]=left[-1],right[k]
           break
    return int("".join(map(str,(left+sorted(right)))))




Shell

Related
pwa install Code Example pwa install Code Example
move one foile/folder to another ubuntu Code Example move one foile/folder to another ubuntu Code Example
how to change home directory of git bash Code Example how to change home directory of git bash Code Example
how to make a batch file that crashes your pc Code Example how to make a batch file that crashes your pc Code Example
gh install ubuntu Code Example gh install ubuntu Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
9