File tree 1 file changed +0
-24
lines changed
src/main/java/com/fishercoder/solutions
1 file changed +0
-24
lines changed Original file line number Diff line number Diff line change 1
1
package com .fishercoder .solutions ;
2
2
3
- /**
4
- * 1047. Remove All Adjacent Duplicates In String
5
- *
6
- * Given a string S of lowercase letters, a duplicate removal consists of choosing two adjacent and equal letters, and removing them.
7
- *
8
- * We repeatedly make duplicate removals on S until we no longer can.
9
- *
10
- * Return the final string after all such duplicate removals have been made. It is guaranteed the answer is unique.
11
- *
12
- *
13
- *
14
- * Example 1:
15
- *
16
- * Input: "abbaca"
17
- * Output: "ca"
18
- * Explanation:
19
- * For example, in "abbaca" we could remove "bb" since the letters are adjacent and equal, and this is the only possible move.
20
- * The result of this move is that the string is "aaca", of which only "aa" is possible, so the final string is "ca".
21
- *
22
- *
23
- * Note:
24
- *
25
- * 1 <= S.length <= 20000
26
- * S consists only of English lowercase letters.*/
27
3
public class _1047 {
28
4
public static class Solution1 {
29
5
public String removeDuplicates (String S ) {
You can’t perform that action at this time.
0 commit comments