Skip to content

Commit

Permalink
Update differenceProductSum.js
Browse files Browse the repository at this point in the history
  • Loading branch information
CharlesCreativeContent authored Oct 25, 2020
1 parent 09916e9 commit 81e1499
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion differenceProductSum.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ Constraints:
* @return {number}
*/
var subtractProductAndSum = function(n) {
let A = [...n.toString().split('').map(Number)]
let A = [...`${n}`].map(Number)
return A.reduce((a, b) => a * b, 1) - A.reduce((a, b) => a + b, 0)
};

0 comments on commit 81e1499

Please sign in to comment.