Skip to content

Commit 737711e

Browse files
add 3884
1 parent 775a9b6 commit 737711e

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

  • paginated_contents/algorithms/4th_thousand
  • src/main/java/com/fishercoder/solutions/fourththousand

‎paginated_contents/algorithms/4th_thousand/README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
| 3903 | [Smallest Stable Index I](https://leetcode.com/problems/smallest-stable-index-i/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3903.java) | | Easy |
2525
| 3898 | [Find the Degree of Each Vertex](https://leetcode.com/problems/find-the-degree-of-each-vertex/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3898.java) | | Easy |
2626
| 3894 | [Traffic Signal Color](https://leetcode.com/problems/traffic-signal-color/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3894.java) | | Easy |
27+
| 3884 | [First Matching Character From Both Ends](https://leetcode.com/problems/first-matching-character-from-both-ends/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3884.java) | | Easy |
2728
| 3838 | [Weighted Word Mapping](https://leetcode.com/problems/weighted-word-mapping/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3838.java) | | Easy |
2829
| 3813 | [Vowel-Consonant Score](https://leetcode.com/problems/vowel-consonant-score/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3813.java) | | Easy |
2930
| 3701 | [Compute Alternating Sum](https://leetcode.com/problems/compute-alternating-sum/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3701.java) | | Easy |
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package com.fishercoder.solutions.fourththousand;
2+
3+
public class _3884 {
4+
public static class Solution1 {
5+
public int firstMatchingIndex(String s) {
6+
for (int i = 0; i < s.length(); i++) {
7+
if (s.charAt(i) == s.charAt(s.length() - i - 1)) {
8+
return i;
9+
}
10+
}
11+
return -1;
12+
}
13+
}
14+
}

0 commit comments

Comments
 (0)