my_subtractProductAndSum
 # Intuition  \n\n\n\n\n\n\n\n\n\n\n\n# Code\n\n/**\n * @param {number} n\n * @return {number}\n */\nvar subtractProductAndSum = function (n) {\n  let pro = 1;\
<!-- # Intuition -->\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n<!-- # Approach -->\n<!-- Describe your approach to solving the problem. -->\n\n<!-- # Complexity\n- Time complexity: -->\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n<!-- - Space complexity: -->\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\n/**\n * @param {number} n\n * @return {number}\n */\nvar subtractProductAndSum = function (n) {\n  let pro = 1;\n  let sum = 0;\n\n  while (n > 0) {\n    const dig = n % 10;\n    pro *= dig;\n    sum += dig;\n    n = Math.floor(n / 10);\n  }\n\n  return pro - sum;\n};\n```
['JavaScript']