Fractal interview question

Binary to integer conversion. Similar to leet code medium