https://github.com/jackhowa/mutations
Check whether the second string in the array has only letters from the first
https://github.com/jackhowa/mutations
algorithm freecodecamp
Last synced: 9 months ago
JSON representation
Check whether the second string in the array has only letters from the first
- Host: GitHub
- URL: https://github.com/jackhowa/mutations
- Owner: JackHowa
- Created: 2017-08-09T21:51:29.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-08-10T20:52:51.000Z (over 8 years ago)
- Last Synced: 2025-01-21T16:44:24.816Z (11 months ago)
- Topics: algorithm, freecodecamp
- Language: JavaScript
- Homepage: https://www.freecodecamp.org/challenges/mutations
- Size: 2.93 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Mutations
Return true if the string in the first element of the array contains all of the letters of the string in the second element of the array.
For example, ["hello", "Hello"], should return true because all of the letters in the second string are present in the first, ignoring case.
The arguments ["hello", "hey"] should return false because the string "hello" does not contain a "y".
Lastly, ["Alien", "line"], should return true because all of the letters in "line" are present in "Alien".
* mutation(["hello", "hey"]) should return false.
* mutation(["hello", "Hello"]) should return true.
* mutation(["zyxwvutsrqponmlkjihgfedcba", "qrstu"]) should return true.
* mutation(["Mary", "Army"]) should return true.
* mutation(["Mary", "Aarmy"]) should return true.
* mutation(["Alien", "line"]) should return true.
* mutation(["floor", "for"]) should return true.
* mutation(["hello", "neo"]) should return false.
* mutation(["voodoo", "no"]) should return false.