rust simple solution
Intuition\nThe simplest way is to check for each possible situation whether it fits the statement.\n\nTo save time one way to to check situation from those with
# Intuition\nThe simplest way is to check for each possible situation whether it fits the statement.\n\nTo save time one way to to check situation from those with most good people to those with least.\n\n# Complexity\n- Time complexity:\n$$O(n^2\\times2^n)$$\n\n- Space complexity:\n$$O(2^n)$$\n\n# Code\n```\nimpl Solution {\n    pub fn maximum_good(statements: Vec<Vec<i32>>) -> i32 {\n        let n=statements.len();\n        let mut states=vec![Vec::new(); n+1];\n        for i in 1..(1<<n) as usize{\n            states[i.count_ones() as usize].push(i);\n        }\n        for i in (1..=n).rev(){\n            for &state in &states[i]{\n                if Self::verify(state, &statements){\n                    return i as i32;\n                }\n            }\n        }\n        0\n    }\n\n    fn verify(state: usize, statements:& Vec<Vec<i32>>)->bool{\n        let n=statements.len();\n        for i in 0..n{\n            if state&1<<i!=0{\n                for (j, &s) in statements[i].iter().enumerate(){\n                    if s!=2&&s!=(state&1<<j>0) as i32{return false}\n                }\n            }\n        }\n        true\n    }\n}\n```
['Bit Manipulation', 'Rust']