Problem p02887 (python)

Fixed submission:
n = int(input())
s = input()

ans = 1
current = s[0]
for i in range(n):
  if current != s[i]:
    ans += 1 
    current = s[i]
print(str(ans))

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
i = 0
while i < n - 1:
  
  while s[i + 1] and s[i] == s[i + 1]:
    s.pop(i + 1)
    n -= 1
  i += 1
print(n)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
i = 0
while i < n - 1:
  if s[i + 1]:
  while s[i] == s[i + 1]:
    s.pop(i + 1)
    n -= 1
  i += 1
print(n)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
i = 0
while i < n - 1:
  while s[i] == s[i + 1]:
    s.pop(i + 1)
    n -= 1
  i += 1
print(n)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
i = 0
while i < n - 1:
  while s[i] == s[i + 1]:
    s.pop(i + 1)
    n -= 1
  i += 1
print(n)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()

ans = 1
current = s[0]
for i in range(n):
  if current != s[i]:
    ans += 1 
    current = s[i]
print ans

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
i = 0
while i < n - 1:
  s = s[i]
  if s[i + 1]:
    while s == s[i + 1]:
      s.pop(i + 1)
      n -= 1
  i += 1
print(n)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
slimes = list(s)
i = 0
while i < n - 1:
  s = slimes[i]
  if slimes[i + 1]:
    while s == slimes[i + 1]:
      slimes.pop(i + 1)
      n -= 1
  i += 1
print(n)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
slimes = list(s)
i = 0
while i < n - 1:
  s = slimes[i]
  if slimes[i + 1]:
    while s == slimes[i + 1]:
      slimes.pop(i)
      n -= 1
  i += 1
print(n)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
slimes = list(s)
i = 0
while i < n - 1:
  s = slimes[i]
  while s == slimes[i + 1]:
    slimes.pop(i)
    n -= 1
  i += 1
print(n)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
slimes = list(s)
i = 0
while i < n - 1:
  s = slimes[i]
  while s == slimes[i + 1]:
    slimes.pop(i + 1)
    n -= 1
  i += 1
print(n)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
slimes = s.split("")
i = 0
while i < n - 1:
  s = slimes[i]
  while s == slimes[i + 1]:
    slimes.pop(i + 1)
    n -= 1
  i += 1
print(str(n))

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
slimes = s.split("")
i = 0
while i < n - 1:
  s = slimes[i]
  while s == slimes[i + 1]:
    slimes.pop(i + 1)
    n -= 1
  i += 1
print(n)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
slimes = s.split("")
i = 0
while i < n - 1:
  s = slimes[i]
  while s == slimes[i + 1]:
    slimes.pop(i + 1)
    n -= 1
  i += 1
print n

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
slimes = s.split("")
i = 0
while i < n - 1:
  s = slimes[i]
  while s == slimes[i+1]:
    del slimes[i+1]
    n -= 1
  i += 1
print n

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
slimes = s.split("")
i = 0
while i < n - 1:
  s = slimes[i]
  while s == slimes[i + 1]:
    del slimes[i + 1]
    n -= 1
  i += 1
print n

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
slimes = list(s.split(''))
i = 0
while i < n - 1:
  s = slimes[i]
  while s == slimes[i + 1]:
    del slimes[i + 1]
    n -= 1
  i += 1
print n