Problem

11 /13


Parity bit

Problem

The input is a bit string - a string consisting of 0 and 1. Pad the original string with the last bit - the parity bit. The parity bit is 0 if the original string has an even number of 1s, and 1 if it is odd (the resulting string should always have an even number of 1s).
 
Examples
# Input Output
1 00110010 001100101