# https://www.reddit.com/r/dailyprogrammer/comments/67q3s6/20170426_challenge_312_intermediate_next_largest/

from itertools import permutations as ps


def get_next(num):
    perms = sorted(set(map(lambda x: int(''.join(x)), ps(str(num)))))
    return perms[perms.index(num) + 1]


def main():
    inp = [
        1234,
        1243,
        234765,
        19000,
    ]

    for i in inp:
        print('{} => {}'.format(i, get_next(i)))


if __name__ == '__main__':
    main()

e4f466d8662f5804cdbd26980fb63f9846fd58dc
<mask token>


def main():
    inp = [1234, 1243, 234765, 19000]
    for i in inp:
        print('{} => {}'.format(i, get_next(i)))


<mask token>

<mask token>


def get_next(num):
    perms = sorted(set(map(lambda x: int(''.join(x)), ps(str(num)))))
    return perms[perms.index(num) + 1]


def main():
    inp = [1234, 1243, 234765, 19000]
    for i in inp:
        print('{} => {}'.format(i, get_next(i)))


<mask token>

<mask token>


def get_next(num):
    perms = sorted(set(map(lambda x: int(''.join(x)), ps(str(num)))))
    return perms[perms.index(num) + 1]


def main():
    inp = [1234, 1243, 234765, 19000]
    for i in inp:
        print('{} => {}'.format(i, get_next(i)))


if __name__ == '__main__':
    main()

from itertools import permutations as ps


def get_next(num):
    perms = sorted(set(map(lambda x: int(''.join(x)), ps(str(num)))))
    return perms[perms.index(num) + 1]


def main():
    inp = [1234, 1243, 234765, 19000]
    for i in inp:
        print('{} => {}'.format(i, get_next(i)))


if __name__ == '__main__':
    main()

# https://www.reddit.com/r/dailyprogrammer/comments/67q3s6/20170426_challenge_312_intermediate_next_largest/

from itertools import permutations as ps


def get_next(num):
    perms = sorted(set(map(lambda x: int(''.join(x)), ps(str(num)))))
    return perms[perms.index(num) + 1]


def main():
    inp = [
        1234,
        1243,
        234765,
        19000,
    ]

    for i in inp:
        print('{} => {}'.format(i, get_next(i)))


if __name__ == '__main__':
    main()
