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

Commit1649f1a

Browse files
add 1750
1 parent5cbd633 commit1649f1a

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-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+
|1750|[Minimum Length of String After Deleting Similar Ends](https://leetcode.com/problems/minimum-length-of-string-after-deleting-similar-ends/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_1750.java)||Medium|Two Pointers|
1112
|1749|[Maximum Absolute Sum of Any Subarray](https://leetcode.com/problems/maximum-absolute-sum-of-any-subarray/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_1749.java)||Medium|Greedy|
1213
|1748|[Sum of Unique Elements](https://leetcode.com/problems/sum-of-unique-elements/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_1748.java)||Easy|Array, HashTable|
1314
|1745|[Palindrome Partitioning IV](https://leetcode.com/problems/palindrome-partitioning-iv/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_1745.java)||Hard|String, DP|
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
packagecom.fishercoder.solutions;
2+
3+
publicclass_1750 {
4+
publicstaticclassSolution1 {
5+
publicintminimumLength(Strings) {
6+
inti =0;
7+
intj =s.length() -1;
8+
if (s.charAt(i) ==s.charAt(j)) {
9+
while (i <j &&s.charAt(i) ==s.charAt(j)) {
10+
charc =s.charAt(i);
11+
i++;
12+
while (c ==s.charAt(i) &&i <j) {
13+
i++;
14+
}
15+
j--;
16+
while (c ==s.charAt(j) &&i <j) {
17+
j--;
18+
}
19+
}
20+
}
21+
returni <=j ?s.substring(i,j).length() +1 :0;
22+
}
23+
}
24+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp