Skip to content

Commit 54b14af

Browse files
add 2810
1 parent be679e3 commit 54b14af

File tree

2 files changed

+18
-0
lines changed
  • paginated_contents/algorithms/3rd_thousand
  • src/main/java/com/fishercoder/solutions/thirdthousand

2 files changed

+18
-0
lines changed

Diff for: paginated_contents/algorithms/3rd_thousand/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
| 2864 | [Maximum Odd Binary Number](https://leetcode.com/problems/maximum-odd-binary-number/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/thirdthousand/_2864.java) | | Easy |Greedy
88
| 2824 | [Count Pairs Whose Sum is Less than Target](https://leetcode.com/problems/count-pairs-whose-sum-is-less-than-target/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/thirdthousand/_2824.java) | | Easy |
99
| 2812 | [Find the Safest Path in a Grid](https://leetcode.com/problems/find-the-safest-path-in-a-grid/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/thirdthousand/_2812.java) | | Medium |BFS
10+
| 2810 | [Faulty Keyboard](https://leetcode.com/problems/faulty-keyboard/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/thirdthousand/_2810.java) | | Easy |
1011
| 2769 | [Find the Maximum Achievable Number](https://leetcode.com/problems/find-the-maximum-achievable-number/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/thirdthousand/_2769.java) | | Easy |
1112
| 2765 | [Longest Alternating Subarray](https://leetcode.com/problems/longest-alternating-subarray/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/thirdthousand/_2765.java) | | Easy |
1213
| 2751 | [Robot Collisions](https://leetcode.com/problems/robot-collisions/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/thirdthousand/_2751.java) | | Hard | Stack, Simulation
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package com.fishercoder.solutions.thirdthousand;
2+
3+
public class _2810 {
4+
public static class Solution1 {
5+
public String finalString(String s) {
6+
StringBuilder sb = new StringBuilder();
7+
for (int i = 0; i < s.length(); i++) {
8+
if (s.charAt(i) == 'i') {
9+
sb.reverse();
10+
} else {
11+
sb.append(s.charAt(i));
12+
}
13+
}
14+
return sb.toString();
15+
}
16+
}
17+
}

0 commit comments

Comments
 (0)