Story points | 3 |
Tags | problem solving data structures |
morse_code.py
Your directory structure should look like this:
morse_code.js
Remember to export both functions like this:
module.exports = { function1Name, function2Name };
Your directory structure should look like this:
MorseCode.java
Create two functions:
letters to morse code
- this should take in a string and return a string.For example if you pass in “Hi there”, it should return “…. .. / - …. . .-. .”
morse code to letters
- this should do the reverse of letters to morse code
Make sure to cater for punctuation marks and all special characters.
Make sure your functions can handle empty strings. For example, the following should behave in a predictable way:
lettersToMorseCode("")
morseCodeToLetters("")