7 kyu
String matchup
1,861 of 5,044KenKamau
Description:
Given two arrays of strings, return the number of times each string of the second array appears in the first array.
Example
array1 = ['abc', 'abc', 'xyz', 'cde', 'uvw']
array2 = ['abc', 'cde', 'uap']
How many times do the elements in array2
appear in array1
?
'abc'
appears twice in the first array (2)'cde'
appears only once (1)'uap'
does not appear in the first array (0)
Therefore, solve(array1, array2) = [2, 1, 0]
Good luck!
If you like this Kata, please try:
Algorithms
Similar Kata:
Stats:
Created | Sep 26, 2017 |
Published | Sep 27, 2017 |
Warriors Trained | 6877 |
Total Skips | 125 |
Total Code Submissions | 11507 |
Total Times Completed | 5044 |
Python Completions | 1861 |
JavaScript Completions | 2051 |
Lua Completions | 189 |
Ruby Completions | 189 |
Haskell Completions | 98 |
Rust Completions | 109 |
Clojure Completions | 18 |
C++ Completions | 704 |
Total Stars | 59 |
% of votes with a positive feedback rating | 92% of 868 |
Total "Very Satisfied" Votes | 745 |
Total "Somewhat Satisfied" Votes | 105 |
Total "Not Satisfied" Votes | 18 |
Total Rank Assessments | 13 |
Average Assessed Rank | 7 kyu |
Highest Assessed Rank | 7 kyu |
Lowest Assessed Rank | 8 kyu |