Leetcode Unique Binary String To Int Python Method