Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
14 lines (11 sloc) 276 Bytes
def base(alien)
result = 0
characters = alien.split('')
base = [characters.uniq.length, 2].max
characters.reverse.each_with_index do |char, index|
if char == characters.first
result += inteiro_na_base(char * base ** index
end
end
return result
end