logo CodeStepByStep logo

MinSubrange

Language/Type: C# algorithms interview strings
Related Links:

Write a method named MinSubrange that accepts two strings s1 and s2 as parameters and returns the minimum-length substring from s1 that contains all characters from s2 in any order. For example, the call of MinSubrange("AXYBDCZDEBAXCY", "ABC") should return "BAXC". If s1 does not contain all characters from s2, return an empty string.

Method: Write a C# method as described, not a complete program or class.

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.