(x)
| 820 | } |
| 821 | |
| 822 | function popCount(x) { |
| 823 | x -= (x >> 1) & 0x55555555; |
| 824 | x = (x & 0x33333333) + ((x >> 2) & 0x33333333); |
| 825 | x = (x + (x >> 4)) & 0x0f0f0f0f; |
| 826 | x += x >> 8; |
| 827 | x += x >> 16; |
| 828 | return x & 0x7f; |
| 829 | } |
| 830 | |
| 831 | function setAt(array, idx, val, canEdit) { |
| 832 | const newArray = canEdit ? array : arrCopy(array); |