DEV Community

Discussion on: Daily Challenge #71 - See you next Happy Year

Collapse
teaglebuilt profile image
dillan teagle

quick python solution

def nextHappyYear(year):
    next_year = year + 1
    yr_list = [int(x) for x in str(year)]
    happy_year = len(set(yr_list)) == len(yr_list)
    if not happy_year:
        return nextHappyYear(next_year)

    return happy_year