Skip to content

Commit c6921b0

Browse files
Merge pull request #174
add new approach for 76 problem 10.04
2 parents ca35f94 + b6d04a4 commit c6921b0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

contest/src/main/java/com/github/contest/slidingWindow/SlidingWindowAlternativeSolution.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ package com.github.contest.slidingWindow
22

33

44
/**
5-
*
5+
* 76. Minimum Window Substring
6+
* Optimum Solution O(n + m)
67
*/
78

89
fun minWindowOptimumSolution(s: String, t: String): String {
@@ -21,6 +22,7 @@ fun minWindowOptimumSolution(s: String, t: String): String {
2122
var formed = 0
2223
val windowCounts = mutableMapOf<Char, Int>()
2324

25+
2426
while (right < s.length) {
2527
val char = s[right]
2628
windowCounts[char] = windowCounts.getOrDefault(char, 0) + 1

0 commit comments

Comments
 (0)