Closed sehnryr closed 4 years ago
If the input was 728, we should espect "AAZ" but actually, the code returns "ABZ"
I could suggest to replace that function by :
def num2alpha(num: int) -> str: def pre_num2alpha(num) -> list: if num % 26 != 0: num = [num // 26, num % 26] else: num = [(num - 1) // 26, 26] if num[0] > 26: num = pre_num2alpha(num[0]) + [num[1]] else: num = list(filter(lambda x: False if x == 0 else True, num)) return num return "".join(list(map(lambda x: chr(x + 64), pre_num2alpha(num))))
That should resolve the issue 😉 (even though it's a totally different code)
Thank you for submitting this, indeed this is a bug. Taking a look at your proposed solution now, but from the looks of it it's super clean!
incorporated in v1.44 thank you for submitting this!!
If the input was 728, we should espect "AAZ" but actually, the code returns "ABZ"
I could suggest to replace that function by :
That should resolve the issue 😉 (even though it's a totally different code)