Skip to content

Commit 930b934

Browse files
refactor 1209
1 parent 74579b5 commit 930b934

File tree

1 file changed

+0
-31
lines changed

1 file changed

+0
-31
lines changed

src/main/java/com/fishercoder/solutions/_1209.java

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,6 @@
22

33
import java.util.Stack;
44

5-
/**
6-
* 1209. Remove All Adjacent Duplicates in String II
7-
*
8-
* Given a string s, a k duplicate removal consists of choosing k adjacent and equal
9-
* letters from s and removing them causing the left and the right side of the deleted substring to concatenate together.
10-
* We repeatedly make k duplicate removals on s until we no longer can.
11-
* Return the final string after all such duplicate removals have been made.
12-
* It is guaranteed that the answer is unique.
13-
*
14-
* Example 1:
15-
* Input: s = "abcd", k = 2
16-
* Output: "abcd"
17-
* Explanation: There's nothing to delete.
18-
*
19-
* Example 2:
20-
* Input: s = "deeedbbcccbdaa", k = 3
21-
* Output: "aa"
22-
* Explanation:
23-
* First delete "eee" and "ccc", get "ddbbbdaa"
24-
* Then delete "bbb", get "dddaa"
25-
* Finally delete "ddd", get "aa"
26-
*
27-
* Example 3:
28-
* Input: s = "pbbcggttciiippooaais", k = 2
29-
* Output: "ps"
30-
*
31-
* Constraints:
32-
* 1 <= s.length <= 10^5
33-
* 2 <= k <= 10^4
34-
* s only contains lower case English letters.
35-
* */
365
public class _1209 {
376
public static class Solution1 {
387
public String removeDuplicates(String s, int k) {

0 commit comments

Comments
 (0)