Uber SSE frontend ds-algo interview question
Anonymous User
1251

// Verify whether a long text is following the order rule defined in order string.
// For example the order string is "abcd", which means "a" can't appear at any position after "b", "c" and "d" in the text, "b" can't appear at any position after "c" and "d" in the text and "c" can't appear at any position after "d" in the text. if the text is "axubbxcxbxd", then the text didn't follow the rule, since "b" appears after "c" in substring "cxb".

Follow up was that , if string was big. and how to handle is there incoming stream of characters.

isValid(string pattern, string tomatch)

I tried to solve using dp , but was overkill and took long time to implement.

Comments (7)