Microsoft | SDE 2

Anonymous User
1875
Jul 29, 2023

OA : Two questions
1. Backtracking Question
2. https://leetcode.com/problems/group-anagrams/

Round 1: Given a set of patterns and a string. Remove given set of patterns from string and output the string without any trace of those patterns.
For example: str = "aebcd", pattern = {"ad", "ec","b"}
returns "" empty string
Explanation: "aebcd" -> "aecd" -> "ad" -> ""

Note: I was not able to solve the question with optimised approach. Although it looks similar to https://leetcode.com/problems/remove-all-occurrences-of-a-substring/ . Really appreciate if you can provide solution of the problem.

Comments (5)