Created
September 3, 2023 11:05
-
-
Save ChousinRahit/6ebde05a7d21fbe0dba6dfd38d33a05e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Replacing Letters with Hashes | |
// Write a function that replaces all letters within a specified range with the hash symbol #. | |
// Examples | |
// replace("abcdef", "c-e") ➞ "ab###f" | |
// replace("rattle", "r-z") ➞ "#a##le" | |
// replace("microscopic", "i-i") ➞ "m#croscop#c" | |
// replace("", "a-z") ➞ "" | |
// Notes | |
// 1 - The range will always be in order, a.k.a. for m-n, character m will always come before or equal n. | |
// 2 - Strings will be in lower case letters only. | |
// 3 - Return an empty string if the input is an empty string. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment