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.
1- Get strings and query respectively
2- iterate over query and filter strings with the same value and get length out of that which is the number of repetition
could be better with reduce function, however, it passes all test cases.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Sparse Arrays
You are viewing a single comment's thread. Return to all comments →
I'd like to share my solution for Javascript
1- Get strings and query respectively 2- iterate over query and filter strings with the same value and get length out of that which is the number of repetition
could be better with reduce function, however, it passes all test cases.