Complete the function which converts a binary number (given as a string) to a decimal number.
def bin_to_dec(str)
str.to_i(2)
end
Complete the function which converts a binary number (given as a string) to a decimal number.
def bin_to_dec(str)
str.to_i(2)
end