3 ms·
This unintentionally but very clearly demonstrates how a few minutes of thought can save a much longer period of computation. Rather than testing all of the in
by cperciva 10y ago
This unintentionally but very clearly demonstrates how a few minutes of thought can save a much longer period of computation. Rather than testing all of the integers between 1 and 500,000,000 (as in the article) or between 1 and 10 * 9^9 (for the trivial upper bound), we can simply test all of the multisets of 10 digits -- of which there are a mere 92378. (Or multisets of up to 10 digits if you take 0^0 = 1, in which case you must consider 184755 possibilities.)