A nice simple one
Input
Given a boolean array (Or an acceptable alternative), you can assume the array will never be more than 32 elements long.
[false, false, true, false, false]
Output
Invert every element of the array and output it.
[true, true, false, true, true]
Rules
- You can write a full program or just a function
- Standard loopholes apply
- Shortest code in bytes, per language, wins!
Test cases
Input:
[true, false]
Output:
[false, true]
Input: //Example of acceptable alternative
[0,1,1]
Output:
[1,0,0]
0
(false, all 0 bits) and-1
(true, all 1 bits)? \$\endgroup\$