You're saying goodbye to your friend when they say to you, "See you next happy year!" You smile and wave, saying you'll see them then. But wait, when's the next happy year anyway?
Given a year, write a function that will return the closest year you'll see your friend, the next year with all unique digits.
Years will always be represented as positive integers. It is not necessary for the year passed through the function to be a Happy one.
nextHappyYear(7712) ==> 7801
nextHappyYear(1001) ==> 1023
nextHappyYear(2018) ==> 2019
Want to propose a challenge idea for a future post? Email firstname.lastname@example.org with your suggestions!