Remove Repeated Letters

Published by Matt in

Create a function that replaces all consecutively repeated letters in a word with single letters.

Examples

removeRepeats("aaabbbccc") ➞ "abc"

removeRepeats("bookkeeper") ➞ "bokeper"

removeRepeats("nananana") ➞ "nananana"

Notes

N/A

Watch a quick demo on how Edabit works.