Files
Ankur Kataria 9391f546d6 perf(project_euler): replace problem_092/sol1 with digit DP (~1500x speedup) (#15141)
* perf(project_euler): replace problem_092 sol1 with digit DP

The previous solution iterated all 10,000,000 values in a Python-level
for-loop (~6 s on GitHub Actions CI).

The new approach uses digit DP over the decimal digits of (number-1):
counts in O(k * 568 * 10) ~ 40k ops how many integers in [0, number-1]
have each digit-square sum, then multiplies by a precomputed lookup of
whether each sum eventually reaches 89.
Running time on the default input drops from ~6 s to ~0.004 s (~1500x).

Closes #8594

* perf(project_euler): replace problem_092/sol1 with digit DP

* chore: remove workflow artifact (.oss-upstream)
2026-08-31 23:37:40 +02:00
..