added solution for BinaryCode problem