Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- decoder = {'0': '0000', '1': '0001', '2': '0010', '3': '0011', '4': '0100', '5': '0101', '6': '0110', '7': '0111', '8': '1000', '9': '1001', 'A': '1010', 'B': '1011', 'C': '1100', 'D': '1101', 'E': '1110', 'F': '1111'}
- double = []
- decode_inp = ([decoder[i] for i in '10836006F'])
- invert = [i[::-1] for i in decode_inp]
- for i in sorted(set(decode_inp)):
- if i in invert:
- invert.remove(i[::-1])
- double.append(i[::-1])
- if double:
- double = sorted(double, reverse=1)
- double = double[1:len(double)] + [double[0]] + [i[::-1] for i in double[1:len(double)][::-1]]
- print(''.join([{v:k for k,v in decoder.items()}[i] for i in double]))
- else:
- print(*double)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement