Spaces:
Runtime error
Runtime error
Download examples/euler1.py from percepta-ai/spotlight-vm: direct link, hf CLI and curl.
- Browser
- Download file 383 Bytes
-
https://huggingface.co/spaces/percepta-ai/spotlight-vm/resolve/main/examples/euler1.py
- Command line
-
hf download hf://spaces/percepta-ai/spotlight-vm/examples/euler1.py
-
curl -L -o euler1.py https://huggingface.co/spaces/percepta-ai/spotlight-vm/resolve/main/examples/euler1.py
383 Bytes
| # https://projecteuler.net/problem=1 | |
| # Sum the multiples of 3 or 5 below 1000. | |
| # Memory allocation within the program translates to Spotlight Memory | |
| def euler1(limit=1000): | |
| marked = bytearray(limit) | |
| for n in range(0, limit, 3): | |
| marked[n] = 1 | |
| for n in range(0, limit, 5): | |
| marked[n] = 1 | |
| return sum(n for n in range(limit) if marked[n]) | |
| print(euler1()) | |