Remove Repeated Letters

Published by Joshua Señoron in

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

Examples

remove_repeats("aaabbbccc") ➞ "abc"

remove_repeats("bookkeeper") ➞ "bokeper"

remove_repeats("nananana") ➞ "nananana"

Notes

N/A

Watch a quick demo on how Edabit works.