Sparse arrays hackerrank solution JavaScript and Python
Firstly declare a list to store the returned list. Secondly, Declare an outer loop which loops through the queries list. Write another loop which will iterate through the values present in stringList List. Declare a counter too, to count the number of occurrences queries element present inside the string List. Check if Element i of Queries List is equal to the element j of stringList. Push the Counter variable inside your returned List