Python O(2^n * n^2) easy to read backtracking
Generate all permutations of Good/Bad combinations (2^N possibilites). Loop through given statements (N^2) and see if: given our current states, if there is a c
Generate all permutations of Good/Bad combinations (2^N possibilites). Loop through given statements (N^2) and see if: given our current states, if there is a contradiction. The only contradictions occur when a good person says a bad person is good or when a good person says a bad person is good. If either of those occur, we can break out of the loop early. Also keeping tracking of a count parameter for how many good people there are. \n```\ndef maximumGood(self, statements):\n        """\n        :type statements: List[List[int]]\n        :rtype: int\n        """\n        def dfs(index,curstate,count):\n            if index == len(curstate):\n                for i in range (len(statements)):\n                    for j in range (len(statements)):\n                        if statements[i][j] == 0 and curstate[i] == \'G\' and curstate[j] == \'G\':\n                            return 0\n                        if statements[i][j] == 1 and curstate[i] == \'G\' and curstate[j] == \'B\':\n                            return 0\n                return count\n            a = dfs(index+1,curstate[:index]+[\'B\']+curstate[index+1:], count-1)\n            b = dfs(index+1,curstate,count)\n            return max(a,b)\n        curstate = [\'G\']*len(statements)\n        return dfs(0,curstate,len(statements))\n\t\t```
['Backtracking', 'Depth-First Search', 'Python']