CodeMettle interview question

convert binary to decimal