The Forbidden Letter

Published by Mubashir Hassan in

Given a letter and an array of words, return whether the letter does not appear in any of the words.

Examples

forbiddenLetter('r', ["rock", "paper", "scissors"]) ➞ false

forbiddenLetter('a', ["spoon", "fork", "knife"]) ➞ true

forbiddenLetter('m', []) ➞ true

Notes

  • All inputs given will be in lowercase.
  • You will always be given a forbidden letter, but there may be empty arrays.
Watch a quick demo on how Edabit works.