mfgnik

Untitled

Jan 18th, 2021
642
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.  
RAW Paste Data