Write a function that converts a binary number, given as a string of 0s and 1s, to its decimal value. Do not rely on a built-in base conversion; raise an error for invalid characters.
You've read your 3 free write-ups
Sign up free to keep reading. Your account opens the first 10 questions of every company.