My ugly answer. But I thought I would at least give this a go in python.
def find_happy_year(string) not_happy = True while(not_happy): for letter in string: same_same = 0 for other_letter in string: if letter == other_letter: same_same += 1 if same_same > 1: not_happy = True string = str( int(string) + 1 ) break else: not_happy = False print (string)
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
My ugly answer. But I thought I would at least give this a go in python.