Skip to content

Instantly share code, notes, and snippets.

@meekg33k
Last active August 23, 2020 04:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save meekg33k/b50845ccaf2480c88b2c48a202d0e874 to your computer and use it in GitHub Desktop.
Save meekg33k/b50845ccaf2480c88b2c48a202d0e874 to your computer and use it in GitHub Desktop.
const findWordsInBoard = (board, listOfWords) => {
/* Returns a subset of words in listOfWords
* that can be formed from characters on board
*/
};
const BOARD = [
['g','r','t','a'],
['n','i','a','e'],
['d','k','w','r'],
['t','e','l','v']
];
const listOfWords = ['nile', 'pea', 'eat', 'grind', 'nike', 'vine', 'take', 'die'];
findWordsInBoard(BOARD, listOfWords); //returns ['eat', 'grind', 'nike']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment