String Week Challenge - Day 1

String Week Challenge - Day 1

Let #Huntober2022 begin!

·

3 min read

Hey all! Welcome to the first day of my first week of daily web dev challenges this October 🎃.

These challenges are designed to be a bit of fun mixed with a bit of coding practice. Beginning each Saturday, the daily tasks will build towards discovering a final solution the following Friday. If that sounds like something you want in on, welcome!

⭐ Here's how it works

  • Each week will have a cumulative goal
  • Each day I'll write a post with the challenge of the day
  • Check my Huntober Twitter for updates (and possible hints)
  • Save your code and solution from day to day! The challenges are cumulative
  • Please don't spoil it for everyone and share your answers without spoiler warnings
  • I'll share my approach and solutions each week
  • Have fun and maybe even learn some tricks!

⭐ String Week

This week our challenges all deal with Strings! As one of JavaScript's primitive data structures, Strings are critical to understand and manipulate. Feel free to use JavaScript's built-in String methods.

🏆 The Challenge - Day 1

This week we will be discovering hidden messages by manipulating a given string. Your solutions should account for any non-empty string. On Friday we'll combine our functions to decode a message.

Oh no! How did this happen?! Somehow similar-looking numbers and letters have been confused in our document. Someone may have been messing around writing naughty words on a calculator. We need to get them back to normal.

Below, find the mix-ups that have been made. Note: the confusion happened in both directions and was case-sensitive.

'0' <-> 'O'      '5' <-> 'S'
'1' <-> 'I'      '6' <-> 'G'
'2' <-> 'Z'      '7' <-> 'L'
'3' <-> 'E'      '8' <-> 'B'
'4' <-> 'h'      '9' <-> 'q'

As an example, here is how a string looks before and after the characters are fixed:

"PR0-T1P #hqB: 1T'5 N1C3 T0 5AY H3770." 
// implement fix function -> 
"PRO-TIP #498: IT'S NICE TO SAY HELLO."

Please create a function that will fix a given string of this mistake before incalculable damage can be done!

If you want to get a head start on untangling this week's message, check out my Huntober Twitter account where I've shared the full input string already.


Wait, What's Huntober?

Leon Noel's 100Devs are spending October preparing for the job hunt. Anyone who has already broken into a tech career knows that the application and interview process can be grueling! The current cohort has progressed this year all the way from basic HTML files to hosted full-stack applications with authentication and databases.

This month they'll continue to build, but will also work on data structures & algorithms, networking and interview skills, and solving code challenges.