Skip to content

Instantly share code, notes, and snippets.

View iykazrji's full-sized avatar

Iyk Azorji iykazrji

View GitHub Profile
@iykazrji
iykazrji / gist:104f8c08d439cd3072b8afeaaa492702
Last active January 6, 2020 11:20
Iyk Azorji Interview code response
/*
* Assume we have a list of words from the English dictionary
* [“water”, “big”, “apple”, “banana”, “york”, “amsterdam”, “orange”, “machintosh”, “bottle”, “book”]
* And another long list go string to process.
* Write a function that will identify “compound words” and return them
* Input: [“paris”, “applewatch”, “ipod”, “bigbook”, “orange”, “waterbottle”]
* Output: [“applewatch”, “bigbook”, “waterbottle”]
*/
const dictionary = ["water", "big", "apple", "banana", "york", "amsterdam", "orange", "machintosh", "bottle", "book"];