Solved LeetCode program · 782 of 1,000
#1018 · Binary Prefix Divisible By 5
Original English source
The bits is a list of 0, 1, and 1. The answers is an empty list of text. The remainder is 0.
For every spot from 0 to the last position of bits.
Set remainder to (remainder times 2 plus item spot of bits) modulo 5. If remainder is 0, Place "true" into answers, otherwise Place "false" into answers.
The line is join answers with ",". Show line.
Expected stdout
true,false,false