9 lines
181 B
Plaintext
9 lines
181 B
Plaintext
|
def main<N>(bool[N] bits) -> field {
|
||
|
field mut out = 0;
|
||
|
for u32 j in 0..N {
|
||
|
u32 i = N - (j + 1);
|
||
|
out = out + (bits[i] ? 2 ** j : 0);
|
||
|
}
|
||
|
return out;
|
||
|
}
|