DEV Community 👩‍💻👨‍💻

Discussion on: Daily Challenge #60 - Find the Missing Letter

designfrontier profile image
Daniel Sellers

This makes an assumption about where the missing letter is in the string that isn't valid for all the test cases?

It returns incorrectly for both test cases that they propose in the problem. You're on the right track but have a little bit more work to do.

cgty_ky profile image
Cagatay Kaya

Thanks for the heads up. I did not get the challenge right and posted a wrong answer. Here is the correct one, I hope :)

missingL = input => {
  const alphabet = [

  const alphabetUp = => item.toUpperCase());

  input[0] == input[0].toUpperCase()
    ? alphabet.splice(0, 26, ...alphabetUp)
    : alphabet;
  const compareArray = alphabet.slice(
    alphabet.indexOf(alphabet[alphabet.indexOf(input[0]) + input.length])

  return compareArray.filter(item => !input.includes(item));