File tree Expand file tree Collapse file tree 1 file changed +3
-22
lines changed
src/main/java/com/fishercoder/solutions Expand file tree Collapse file tree 1 file changed +3
-22
lines changed Original file line number Diff line number Diff line change 22
33import java .util .Arrays ;
44
5- /**
6- * 727. Minimum Window Subsequence
7- *
8- * Given strings S and T, find the minimum (contiguous) substring W of S, so that T is a subsequence of W.
9- * If there is no such window in S that covers all characters in T,
10- * return the empty string "". If there are multiple such minimum-length windows, return the one with the left-most starting index.
11-
12- Example 1:
13- Input:
14- S = "abcdebdde", T = "bde"
15- Output: "bcde"
16-
17- Explanation:
18- "bcde" is the answer because it occurs before "bdde" which has the same length.
19- "deb" is not a smaller window because the elements of T in the window must occur in order.
20-
21- Note:
22- All the strings in the input will only contain lowercase letters.
23- The length of S will be in the range [1, 20000].
24- The length of T will be in the range [1, 100].
25- */
265public class _727 {
276 public static class Solution1 {
287 /**
@@ -53,7 +32,9 @@ private boolean isSubsequence(String T, String sub) {
5332 }
5433
5534 public static class Solution2 {
56- /**credit: https://github.com/lydxlx1/LeetCode/blob/master/src/_727.java*/
35+ /**
36+ * credit: https://github.com/lydxlx1/LeetCode/blob/master/src/_727.java
37+ */
5738 public String minWindow (String S , String T ) {
5839 int [][] dp = new int [S .length () + 1 ][T .length () + 1 ];
5940 int INFINITY = 1 << 29 ;
You can’t perform that action at this time.
0 commit comments