Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Second solution in Clear category for Integer Palindrome by freeman_lex
def int_palindrome(number: int, B: int) -> bool:
rev = []
while number:
number, b = divmod(number, B)
rev.append(b)
return rev == rev[::-1]
print("Example:")
print(int_palindrome(455, 2))
assert int_palindrome(6, 2) == False
assert int_palindrome(34, 2) == False
assert int_palindrome(455, 2) == True
print("The mission is done! Click 'Check Solution' to earn rewards!")
Nov. 10, 2022