We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Sparse Arrays
- Discussions
Sparse Arrays
Sparse Arrays
Sort by
recency
|
222 Discussions
|
Please Login in order to post a comment
Hey folks, Here is the optimized solution in javascript, that will runs in O(n) optimization.
Inside the
for-loop
, if any match found then I added one key word calledcontinue
which means, the statement after thecontinue
key word will not run for that iteration.def matchingStrings(strings, queries):
python solution 2 types 1) nested for loops
2)using count function