polyglot-euler icon indicating copy to clipboard operation
polyglot-euler copied to clipboard

Python 104

Open murilocamargos opened this issue 6 years ago • 0 comments

How the solution works

This is a brute force solution with two optimizations:

  1. Getting first and last 9 digits without transforming it to string so we don't need to convert the entire number (it's big);
  2. Checking if the number is divisible by three, all 1-9 pandigital numbers are divisible by three.

Performance

Python 3

Real time: 24.138 s
User time: 23.978 s
Sys. time: 0.015 s
CPU share: 99.40 %
Exit code: 0

murilocamargos avatar May 15 '18 18:05 murilocamargos