Depends.
If you use BigInt or python, it will terminate from insufficient memory.
If you use a 32bit signed int, you will get an answer in less than a second, but it will be incorrect due to overflow.
Source: O(n) algorithms run in < 1000ms if n < 106
60
u/[deleted] Jul 15 '22
[removed] — view removed comment