Advertisement
mfgnik

Untitled

Jan 18th, 2021
920
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.24 KB | None | 0 0
  1. x, k = map(int, input().split())
  2. x_str = str(x)
  3. x_sorted = sorted(x_str)
  4. if k == 0:
  5.     if x_str[0] == x_sorted[-1]:
  6.         print(x_str[0] * len(x_sorted))
  7.     else:
  8.         print(str(int(x_str[0]) + 1) * len(x_sorted))
  9. else:
  10.     print(x)
  11.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement