greedy, try_fold
Code\n\nimpl Solution {\n    pub fn lemonade_change(bills: Vec<i32>) -> bool {\n        bills.into_iter().try_fold([0,0],|[a,b],x|\n            match x {\n     
# Code\n```\nimpl Solution {\n    pub fn lemonade_change(bills: Vec<i32>) -> bool {\n        bills.into_iter().try_fold([0,0],|[a,b],x|\n            match x {\n                5  => Some([a+1, b]),\n                10 if a > 0 => Some([a-1,b+1]),\n                20 if a > 0 && b > 0  => Some([a-1, b-1]),\n                20 if a > 2 && b == 0 => Some([a-3, b]),\n                _ => None,\n                }\n        ).is_some()\n    }\n}\n```
['Rust']