2151. Maximum Good People Based on Statements
IntuitionApproachComplexity
Time complexity:

Space complexity:
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```python3 []
from typing import List

class Solution:
    def maximumGood(self, statements: List[List[int]]) -> int:
        num_people = len(statements)
        best_count = 0

        def validate_configuration(configuration):
            for i in range(num_people):
                if configuration[i] == '0':
                    continue
                for j in range(num_people):
                    if statements[i][j] == 2:
                        continue
                    if (statements[i][j] == 1 and configuration[j] == '0') or (statements[i][j] == 0 and configuration[j] == '1'):
                        return False
            return True

        for mask in range(1 << num_people):
            binary_representation = bin(mask)[2:].zfill(num_people)
            if validate_configuration(binary_representation):
                best_count = max(best_count, binary_representation.count('1'))

        return best_count

# Example usage
solution = Solution()
print(solution.maximumGood([[2, 1, 2], [1, 2, 0], [2, 0, 2]]))  # Example input
print(solution.maximumGood([[2, 0], [0, 2]]))  # Example input
```
['Python3']