Created
September 3, 2023 11:04
-
-
Save ChousinRahit/08d1f226e2817b11ae694e4bb23114f4 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
// Stretched Words | |
// Write a function that takes a string, and returns a new string with any duplicate consecutive letters removed. | |
// Examples | |
// unstretch("ppoeemm") ➞ "poem" | |
// unstretch("wiiiinnnnd") ➞ "wind" | |
// unstretch("ttiiitllleeee") ➞ "title" | |
// unstretch("cccccaaarrrbbonnnnn") ➞ "carbon" | |
// Notes | |
// Final strings won't include words with double letters (e.g. "passing", "lottery"). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment