Skip to content

Latest commit

 

History

History
8 lines (5 loc) · 277 Bytes

File metadata and controls

8 lines (5 loc) · 277 Bytes

Write a function neighbour_repeat(word: str) -> str that removes any identical letters placed back-to-back with each other:

For example:

  • NeighbourRepeat("hello")heo
  • NeighbourRepeat("awesome")awesome
  • NeighbourRepeat("aaaaabbbcde")cde