Skip to content

eulersnumber

bradendubois edited this page Nov 24, 2021 · 8 revisions

Euler's Number

ID: eulersnumber

Difficulty: 2.3

CPU Time: 1 second

Memory: 1024 MB

Solution

One can calculate the approximation exactly as detailed in the description, but don't recompute the factorial for each digit from 0 to n; factoral(i) = i * factorial(i-1), so one can simply use a loop or something to do each, and build the next factorial off of the last.

Clone this wiki locally