• + 16 comments

    Dont bother swapping characters until you find a valid string. Here is the trick:

    Happy Conditions:

    = There are at least one empty cell and there is no Letter with count 1

    OR

    = There is no empty cell but the given string is happy