Sichanov

next_happy_year

Sep 17th, 2021
303
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.30 KB | None | 0 0
  1. initial_year = int(input())
  2. next_year = initial_year + 1
  3.  
  4. while True:
  5.     new_year = ''
  6.     for i in str(next_year):
  7.         if i not in new_year:
  8.             new_year += i
  9.         else:
  10.             continue
  11.     if int(new_year) > initial_year:
  12.         break
  13.     next_year += 1
  14.  
  15. print(new_year)
  16.  
Advertisement
Add Comment
Please, Sign In to add comment