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

Commit4382494

Browse files
add 1880
1 parentcc32244 commit4382494

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

‎README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ _If you like this project, please leave me a star._ ★
88

99
| # | Title | Solutions | Video | Difficulty | Tag
1010
|-----|----------------|---------------|--------|-------------|-------------
11+
|1880|[Check if Word Equals Summation of Two Words](https://leetcode.com/problems/check-if-word-equals-summation-of-two-words/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_1880.java)||Easy|String|
1112
|1877|[Minimize Maximum Pair Sum in Array](https://leetcode.com/problems/minimize-maximum-pair-sum-in-array/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_1877.java)||Medium|Greedy, Sort|
1213
|1876|[Substrings of Size Three with Distinct Characters](https://leetcode.com/problems/substrings-of-size-three-with-distinct-characters/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_1876.java)||Easy|String|
1314
|1869|[Longer Contiguous Segments of Ones than Zeros](https://leetcode.com/problems/longer-contiguous-segments-of-ones-than-zeros/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_1869.java)||Easy|Array, Two Pointers|
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
packagecom.fishercoder.solutions;
2+
3+
publicclass_1880 {
4+
publicstaticclassSolution1 {
5+
publicbooleanisSumEqual(StringfirstWord,StringsecondWord,StringtargetWord) {
6+
StringBuildersb =newStringBuilder();
7+
inta =getSum(firstWord,sb);
8+
sb.setLength(0);
9+
intb =getSum(secondWord,sb);
10+
sb.setLength(0);
11+
intc =getSum(targetWord,sb);
12+
returna +b ==c;
13+
}
14+
15+
privateintgetSum(StringfirstWord,StringBuildersb) {
16+
for (charc :firstWord.toCharArray()) {
17+
sb.append(c -'a');
18+
}
19+
returnInteger.parseInt(sb.toString());
20+
}
21+
}
22+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp