Cleanup your ugly Boolean expressions with De Morgan’s laws
This is a simple trick that can be handy to cleanup or simplify Boolean expressions, and is always good to have in your code-writing toolchest: De Morgan’s laws.
These two laws allow to apply a negation to an and or or expression: