O(n) 96% Faster | No Array, No parse + Explanation
\nvar subtractProductAndSum = function(n) {\n    let sum = 0;\n    let multiply = 1;\n    while (n >= 1) {\n        const mod = (n % 10)\n        sum += mod\n  
```\nvar subtractProductAndSum = function(n) {\n    let sum = 0;\n    let multiply = 1;\n    while (n >= 1) {\n        const mod = (n % 10)\n        sum += mod\n        multiply *= mod\n        n = parseInt(n / 10);\n    }\n    \n    return multiply - sum;\n};\n```\n\nYou can iterate over an integer using division by 10 and mod, this will give to you the reverse integer, but for the test purposes, it doesn\'t matter if we revert the number, because all we need to do is sum and multiply each number.\nconst multiply starts in 1 because n * 1 = n. If I started to multiply with 0, the result of all multiply would be 0 because n * 0 = 0
['JavaScript']