I think this problem can be solved in a math way, maybe. Any ideas/solutions?


  • 0

    In total, there are 3^n possible combinations.
    I think the result should be something like:
    3^n - the combination of having more than or equals 2 'A's - the combination of having more than 2 continuous 'L's + the overlap of the 2 substracts above.


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.