result
to store the boolean values.current_remainder
to 0 to keep track of the remainder when divided by 5.nums
array.
a. Update current_remainder
by multiplying it by 2, adding the current bit, and then taking the modulus by 5.
b. Append True
to result
if current_remainder
is 0; otherwise, append False
.result
list.