Skip to main content
1 of 3
DJMcMayhem
  • 60.1k
  • 18
  • 203
  • 352

V (vim), 7 bytes

Óˆ± Ø^$ 

Try it online! or Verify test cases

Hexdump:

00000000: d388 b10a d85e 24 .....^$ 

Just two regexes. Explanation:

Ó " Remove all occurrences... ˆ " Any character ± " Followed by itself " This regex is actually just the compressed form of (.)\1 Ø " Count the number of matches ^$ " An empty line 
DJMcMayhem
  • 60.1k
  • 18
  • 203
  • 352