Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

Harmless ransom note

Description

Harmless ransom note is an algorithm that defines is it possible to create string with the words present in the magazine text or not.

Implementation

harmlessRansomNote(noteText, magazineText) should return true if it's possible to create string noteText from magazineText and false otherwise.

MEMO: words with punctuation marks (e.g. !, ?, etc.) will be defined as a whole.

Example:

harmlessRansomNote('all in', 'This is all text in magazine') // true