SOLVED & EXPLAINED - Sparse Arrays (JavaScript) | Data Structures & Algorithm

Publicado el: 01 enero 1970
en el canal de: Geekelo - Female Tech Enthusiast
101
like

QUESTION:
------
Join free Membership Community - https://tinyurl.com/geekspecials
Connect on LinkedIn -   / eloghene-otiede  
-------

There is a collection of input strings and a collection of query strings. For each query string, determine how many times it occurs in the list of input strings. Return an array of the results.

Example:
strings = ['ab',' ab', abc']
queries = ['ab',' abc',' bc']
There are 2 instances of 'ab', 1 of 'abc' and 0 of 'be'. For each query, add an element to the return array, results = [2, 1, 0].

Function Description:
Complete the function matchingStrings in the editor below. The function must return an array of integers representing the frequency of occurrence of each query string in strings.

matchingStrings has the following parameters:
• string strings[n] - an array of strings to search
• string queries[q] - an array of query strings

Returns:
⚫ int[q]: an array of results for each query

Input Format:
The first line contains and integer n, the size of strings[]. Each of the next lines contains a string strings[i]. The next line contains q, the size of queries[].
Each of the next & lines contains a string queries[i].


En esta página del sitio puede ver el video en línea SOLVED & EXPLAINED - Sparse Arrays (JavaScript) | Data Structures & Algorithm de Duración hora minuto segunda en buena calidad , que subió el usuario Geekelo - Female Tech Enthusiast 01 enero 1970, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 101 veces y le gustó like a los espectadores. Disfruta viendo!