DevHireLab
TutorialsBootcamp
Problems
Code SimulatorAI InterviewSoonContact
DevHireLab
TutorialsBootcamp
Problems
Code SimulatorAI InterviewSoonContact
Back to Arena
medium
String

Minimum Window Subsequence

**Problem Statement:** Given the required input arguments, write an efficient algorithm to solve the **Minimum Window Subsequence** problem. Implement the required logic as specified by standard definitions for this classic algorithmic challenge. **Hint / Expected Approach:** Two-pointer forward then shrink backward **Edge Cases to Consider:** - (1) t longer than s - (2) t = s exactly - (3) Multiple equal-length windows

Examples

Example 1
Input: "abcdebdde", "bde"
Output: "bcde"
Example 2
Input: "jmeqksfrsdcmsiwvaovztaqenprpvnbstl", "u"
Output: ""
Explanation: Not found
Example 3
Input: "abc", "abc"
Output: "abc"
Explanation: Same

Constraints

  • ▪1 <= s.length <= 10^4
  • ▪s consists of printable ASCII characters
  • ▪Solve with optimal space complexity

Watch Out For Edge Cases

  • ▪t longer than s
  • ▪t = s exactly
  • ▪Multiple equal-length windows
Frequently Asked At
GoogleAmazonAdobe