for this problem: 89C - Chip Play My try is: 2462423
I am getting TLE for test 31.
MY solution is N^2. I am trying to solve the problem with dfs type recursion. before recursion i am removing that chip. than after traversing i am putting back that chip like backtracking. I am getting TLE.. How to optimize it ? anybody help!!