Last active
January 24, 2023 18:21
-
-
Save rahul4coding/64023e39017f0a5915a9ff884d18446d to your computer and use it in GitHub Desktop.
Sparse Arrays Hackerrank Solution by Rahul Bhatija
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://www.hackerrank.com/challenges/sparse-arrays | |
// Simple JavaScript solution | |
function matchingStrings(strings, queries) { | |
return queries.map(x=>strings.filter(y=>y===x).length) | |
} |
this is brillient i like your code ๐
Hello could you please explain how the code works? I Looked at the problem I have no clue how to solve it.
wow,, this is awesome
Sparse arrays hackerrank solution JavaScript and Python
You just have to iterate over the values in queries and check through .count function that particular value exist in stringList or not.
https://hecodesit.com/sparse-arrays-hackerrank-solution-javascript-and-python/
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this is brillient i like your code ๐