407182: GYM102697 153 Parity Checker
Description
Though digital communications are highly accurate, errors can occur from time to time. To deal with such communications errors, methods to detect and fix errors have been invented. One very common and simple method for this is known as a parity bit. When a message is being sent digitally in the form of bytes of 8 bits, a ninth parity bit can be added that is either 1 if the message has an even number of 1s(in binary), or 0 if the message has an odd number of 1s. While this method clearly will only work if there are an odd number of errors, it is a useful heuristic for detecting many errors without the need for more computation intensive methods. Your task for this problem is to write a program to determine if a nine bit sequence of binary is valid according to a parity check. The first bit on the left represents the parity bit, and the following 8 bits correspond to the one byte message that is to evaluated for parity.
InputExactly 9 consecutive binary bits will be provided as input in the form of a one-line string with no spaces. The first bit on the left represents the even-parity bit, and the next eight bits represent the message being communicated.
OutputOutput either "NO ERROR" if the parity check is valid or "TRANSMISSION ERROR" if the parity check fails.
ExampleInput100110101Output
NO ERROR