Skip to content

Instantly share code, notes, and snippets.

View rahul4coding's full-sized avatar
🏠
Working from home

Rahul Bhatija rahul4coding

🏠
Working from home
View GitHub Profile
@rahul4coding
rahul4coding / SparseArray.js
Last active January 24, 2023 18:21
Sparse Arrays Hackerrank Solution by Rahul Bhatija
// https://www.hackerrank.com/challenges/sparse-arrays
// Simple JavaScript solution
function matchingStrings(strings, queries) {
return queries.map(x=>strings.filter(y=>y===x).length)
}