Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
6-liner: easy solution in Clear category for Ugly Numbers by przemyslaw.daniel
def ugly_number(position: int) -> int:
found = {1}
for _ in range(position):
found -= {ugly:=min(found)}
found |= {2*ugly, 3*ugly, 5*ugly}
return ugly
Dec. 8, 2021
Comments: