Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
quest grinding solution in Uncategorized category for Ghost Detect by Bifftastic
from itertools import groupby as g
def recognize(s: int) -> bool:
return len({len(list(b))for f,b in g(f"{s:08b}")if f=="1"})==1
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. 18, 2024
Comments: