Grokking the Coding Interview: Patterns for Coding Questions
Ask Author
Back to course home

0% completed

Vote For New Content
Mismatch between constraint and test cases

Kai

May 9, 2024

The constraint says the length of str and pattern is greater than 0.

However, there're test cases with empty string

For example,

  1. str: "", pattern: ""

  2. str: "ab", pattern: ""

Even if the correct constraint is "equal or greater than 0", why #1's expected result is false but #2 is true?

2

0

Comments
Comments
Owens Ehimen
Owens Ehimena year ago

I agree with this. Just ran into the same problem

On this page