Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit28f43d4

Browse files
refactor 1281
1 parentd50b9bf commit28f43d4

File tree

1 file changed

+0
-24
lines changed

1 file changed

+0
-24
lines changed

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

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,5 @@
11
packagecom.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
publicclass_1281 {
284
publicstaticclassSolution1 {
295
publicintsubtractProductAndSum(intn) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp