Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
split whitespaces solution in Uncategorized category for Ghost Detect by mu_py
def recognize(signal: int) -> bool:
l=bin(signal)[2:].replace('0',' ').split()
return min(l) == max(l)
print("Example:")
print(recognize(21))
# These "asserts" are used for self-checking
assert recognize(21) == True
assert recognize(1587) == True
assert recognize(3687) == False
print("The mission is done! Click 'Check Solution' to earn rewards!")
Nov. 15, 2024
Comments: