6 kyu
Which are in?
2,712 of 82,592g964
Description:
Given two arrays of strings a1
and a2
return a sorted array r
in lexicographical order of the strings of a1
which are substrings of strings of a2
.
Example 1:
a1 = ["arp", "live", "strong"]
a2 = ["lively", "alive", "harp", "sharp", "armstrong"]
returns ["arp", "live", "strong"]
Example 2:
a1 = ["tarp", "mice", "bull"]
a2 = ["lively", "alive", "harp", "sharp", "armstrong"]
returns []
Notes:
- Arrays are written in "general" notation. See "Your Test Cases" for examples in your language.
- In Shell bash
a1
anda2
are strings. The return is a string where words are separated by commas. - Beware: In some languages
r
must be without duplicates.
Arrays
Lists
Strings
Refactoring
Stats:
Created | Mar 15, 2015 |
Published | Mar 15, 2015 |
Warriors Trained | 175887 |
Total Skips | 30053 |
Total Code Submissions | 356551 |
Total Times Completed | 82592 |
Ruby Completions | 2971 |
C# Completions | 4893 |
Python Completions | 27752 |
Java Completions | 8954 |
Clojure Completions | 451 |
Haskell Completions | 775 |
JavaScript Completions | 23094 |
CoffeeScript Completions | 77 |
Elixir Completions | 456 |
TypeScript Completions | 2518 |
C++ Completions | 3406 |
PHP Completions | 2712 |
Crystal Completions | 47 |
F# Completions | 168 |
C Completions | 605 |
Swift Completions | 972 |
R Completions | 181 |
Shell Completions | 150 |
OCaml Completions | 40 |
Julia Completions | 82 |
Scala Completions | 402 |
PowerShell Completions | 107 |
Kotlin Completions | 1085 |
Go Completions | 1759 |
Nim Completions | 33 |
Racket Completions | 38 |
Rust Completions | 878 |
Lua Completions | 94 |
Pascal Completions | 14 |
Perl Completions | 22 |
Elm Completions | 15 |
D Completions | 8 |
Erlang Completions | 11 |
Prolog Completions | 14 |
Total Stars | 1552 |
% of votes with a positive feedback rating | 87% of 6987 |
Total "Very Satisfied" Votes | 5394 |
Total "Somewhat Satisfied" Votes | 1425 |
Total "Not Satisfied" Votes | 168 |