DEV Community

DPC
DPC

Posted on

8 3 4 4 5

Daily JavaScript Challenge #JS-70: Find Missing Letter in Alphabet Sequence

Daily JavaScript Challenge: Find Missing Letter in Alphabet Sequence

Hey fellow developers! 👋 Welcome to today's JavaScript coding challenge. Let's keep those programming skills sharp!

The Challenge

Difficulty: Easy

Topic: String Manipulation

Description

Given a sequence of consecutive letters in the alphabet, find the missing letter in the sequence. The function receives an array of lowercase characters representing a range from any starting letter of the alphabet to ending. The sequence will always have one letter missing, and the array length will always be 1 to 25 (inclusive). Return the missing letter as lowercase.

Ready to Begin?

https://www.dpcdev.com/

  1. Fork this challenge
  2. Write your solution
  3. Test it against the provided test cases
  4. Share your approach in the comments below!

Want to Learn More?

Check out the documentation about this topic here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charCodeAt

Join the Discussion!

  • How did you approach this problem?
  • Did you find any interesting edge cases?
  • What was your biggest learning from this challenge?

Let's learn together! Drop your thoughts and questions in the comments below. 👇


This is part of our Daily JavaScript Challenge series. Follow me for daily programming challenges and let's grow together! 🚀

javascript #programming #coding #dailycodingchallenge #webdev

SurveyJS custom survey software

Build Your Own Forms without Manual Coding

SurveyJS UI libraries let you build a JSON-based form management system that integrates with any backend, giving you full control over your data with no user limits. Includes support for custom question types, skip logic, an integrated CSS editor, PDF export, real-time analytics, and more.

Learn more

Top comments (5)

Collapse
 
annabelle1217 profile image
Annabelle Ng • Edited

why the comment is empty~

tried an approach without using the charCodeAt

function findMissingAlphabet (letters) {
    const alphabet = 'abcdefghijklmnopqrstuvwxyz';
    const startIndex = alphabet.indexOf(letters[0]);

    const fullChar = alphabet.slice(startIndex, startIndex+letters.length+1);
    const fullLetters = [...fullChar];
    for (let i = 0; i < fullLetters.length; i++) {
        if (fullLetters[i] !== letters[i]) return fullLetters[i];
    }
}
Enter fullscreen mode Exit fullscreen mode
Collapse
 
annabelle1217 profile image
Annabelle Ng

but miss the challenge, looks like we can't post answer to old challenge 🤔

Collapse
 
dpc profile image
DPC

Thanks for your comment! Very very soon you will be able to code on old challenges! Currently working on it

Thread Thread
 
annabelle1217 profile image
Annabelle Ng

Thank you for all the effort! It’s already great as it is—even without access to old challenges👏✨

Thread Thread
 
dpc profile image
DPC

Thank you! 🩷

The Most Contextual AI Development Assistant

Pieces.app image

Our centralized storage agent works on-device, unifying various developer tools to proactively capture and enrich useful materials, streamline collaboration, and solve complex problems through a contextual understanding of your unique workflow.

👥 Ideal for solo developers, teams, and cross-company projects

Learn more