scala solution
```\n    def subtractProductAndSum(n: Int): Int = {\n        val list = n.toString.split("").map(_.toInt)\n        list.product - list.sum\n    }
```\n    def subtractProductAndSum(n: Int): Int = {\n        val list = n.toString.split("").map(_.toInt)\n        list.product - list.sum\n    }
['Scala']