C
csharpula csharp
Hello ,
I need to perform the following operation:
There are two strings (str1 and strSet) ,I need to write a function
which will get str1 and strSet and will return an index of the first
occurrence of a character in str1 that belongs to the set of characters
in strSet.
I need to perform it with complexity of O(m+n) /n-str lenght ,m-strSet
lenght.
For example: str="fsaghj" strSet="bya" the output will be 3 (the index
of "a" in str).
How can I do it?
Thanks a lot
I need to perform the following operation:
There are two strings (str1 and strSet) ,I need to write a function
which will get str1 and strSet and will return an index of the first
occurrence of a character in str1 that belongs to the set of characters
in strSet.
I need to perform it with complexity of O(m+n) /n-str lenght ,m-strSet
lenght.
For example: str="fsaghj" strSet="bya" the output will be 3 (the index
of "a" in str).
How can I do it?
Thanks a lot