Can someone explain the approach along with the code snippet.

  • 0

    I tried in java but ran out of time. I was trying to use recursion to list out all possible ways and choose the one with minimum insertions. I'm keen on knowing what approach was taken rather than just the code snippet.

  • 0

    I did what you described. Brute force recursion of all possible game states. I thought this would work because the game state size was pretty small. There's definately a DP solution that would be better but I'm not that good with it.

Log in to reply

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