Skip to content

Commit 28f43d4

Browse files
refactor 1281
1 parent d50b9bf commit 28f43d4

File tree

1 file changed

+0
-24
lines changed

1 file changed

+0
-24
lines changed

src/main/java/com/fishercoder/solutions/_1281.java

-24
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,5 @@
11
package com.fishercoder.solutions;
22

3-
/**
4-
* 1281. Subtract the Product and Sum of Digits of an Integer
5-
*
6-
* Given an integer number n, return the difference between the product of its digits and the sum of its digits.
7-
*
8-
* Example 1:
9-
* Input: n = 234
10-
* Output: 15
11-
* Explanation:
12-
* Product of digits = 2 * 3 * 4 = 24
13-
* Sum of digits = 2 + 3 + 4 = 9
14-
* Result = 24 - 9 = 15
15-
*
16-
* Example 2:
17-
* Input: n = 4421
18-
* Output: 21
19-
* Explanation:
20-
* Product of digits = 4 * 4 * 2 * 1 = 32
21-
* Sum of digits = 4 + 4 + 2 + 1 = 11
22-
* Result = 32 - 11 = 21
23-
*
24-
* Constraints:
25-
* 1 <= n <= 10^5
26-
* */
273
public class _1281 {
284
public static class Solution1 {
295
public int subtractProductAndSum(int n) {

0 commit comments

Comments
 (0)