JS Solution | Runtime beats 96.80%
Code\n\n/**\n * @param {number} n\n * @return {number}\n */\nvar subtractProductAndSum = function(n) {\n    let s = n.toString(); \n    let sum = 0;\n    let di
# Code\n```\n/**\n * @param {number} n\n * @return {number}\n */\nvar subtractProductAndSum = function(n) {\n    let s = n.toString(); \n    let sum = 0;\n    let digit = 1; \n    for (let i = 0; i < s.length; i++){\n        sum += Number(s[i]);\n        digit *= Number(s[i]);\n    }\n    return digit-sum;\n};\n```
['JavaScript']