C#
\npublic int SubtractProductAndSum(int n) {\n\tvar digits = GetDigits(n);\n\tvar product = digits.Aggregate(1, (x, y) => x * y);\n\tvar sum = digits.Aggregate(0
```\npublic int SubtractProductAndSum(int n) {\n\tvar digits = GetDigits(n);\n\tvar product = digits.Aggregate(1, (x, y) => x * y);\n\tvar sum = digits.Aggregate(0, (x, y) => x + y);\n\n\treturn product - sum;\n\n\tList<int> GetDigits(int i) {\n\t\tif (i == 0) return new List<int> { 0 };\n\t\tvar list = new List<int>();\n\t\twhile (i > 0) { list.Add(i % 10); i /= 10; }\n\t\treturn list;\n\t}\n}\n```
[]