logo CodeStepByStep logo

minSubrange

Language/Type: Java 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 Java 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.