qyliang/CodeNanoFix huggingface dataset:
Buggy code:
n = int(input())
s = input()
k = int(input())
for i in s:
  if s[i] == s[k-1]:
    s[i] = '*'
    print(s[i], end = '')

Fixed code:
n=int(input())
s=input()
k=int(input())

for i in range(n):
  if s[i]==s[k-1]:
    print(s[i],end="")
  else:
    print("*",end="")

print("")
Buggy code:
n = int(input())
s = input()
k = int(input())
ss = ''
for i in range(n):
	if s[i] == s[k]:
		ss += s[i]
	else:
		ss += '*'
print(ss)

Fixed code:
n = int(input())
s = input()
k = int(input())
ss = ''
for i in range(n):
	if s[i] == s[k-1]:
		ss += s[i]
	else:
		ss += '*'
print(ss)
Buggy code:
n=int(input())
s=list(input())
k=int(input())
num=s[k-1]
num=str(num)
for i in range (0,n):
  if s[i]==num:
    s[i]="*"
s=''.join(s)
print(s)

Fixed code:
n=int(input())
s=list(input())
k=int(input())
num=s[k-1]
num=str(num)
for i in range (0,n):
  if s[i]!=num:
    s[i]="*"
s=''.join(s)
print(s)
Buggy code:
# coding: utf-8

import sys
input = sys.stdin.readline

N = int(input())
S = input()
K = int(input())

moji = S[K - 1]

for s in S:
    print("*" if s != moji else s, end="")

print()


Fixed code:
# coding: utf-8

import sys
input = sys.stdin.readline

N = int(input())
S = input()[:-1]
K = int(input())

moji = S[K - 1]

for s in S:
    print("*" if s != moji else s, end="")

print()
Buggy code:
n = input()
s = input()
k = int(input())

target_char = s[k]

out = ""
for s_i in s:
	if s_i != target_char:
		out += "*"
	else:
		out += s_i

print(out)

Fixed code:
n = input()
s = input()
k = int(input())

target_char = s[k-1]

out = ""
for s_i in s:
	if s_i != target_char:
		out += "*"
	else:
		out += s_i

print(out)
Buggy code:
n=int(input())
s=list(input())
k=int(input())
for i in range(n):
    if s[i] != s[k-1]:
        s[i]=s[k-1]
print(''.join(s))


Fixed code:
n=int(input())
s=list(input())
k=int(input())
for i in range(n):
    if s[i] != s[k-1]:
        s[i]="*"
print(''.join(s))
Buggy code:
N = int(input())
S = input()
K = int(input())

s = ''
for i in range(N):
    if S[i] != S[K-1]:
        s += S[i]
    else:
        s += '*'

print(s)

Fixed code:
N = int(input())
S = input()
K = int(input())

s = ''
for i in range(N):
    if S[i] == S[K-1]:
        s += S[i]
    else:
        s += '*'

print(s)
Buggy code:
import sys

n = int(input()) 
s = list(input()) 
k = int(input()) 

word = s[k]
for i in s:
    if i != word:
        sys.stdout.write('*')
    else:
        sys.stdout.write(i)

Fixed code:
import sys

n = int(input()) 
s = list(input()) 
k = int(input()) 

word = s[k-1]
for i in s:
    if i != word:
        sys.stdout.write('*')
    else:
        sys.stdout.write(i)
Buggy code:
n=int(input())
s=input()
k=int(input())
key=s[k]
ans=""
for i in range(len(s)):
  if s[i]==key:
    ans+=key
  else:
    ans+="*"
print(ans)

Fixed code:
n=int(input())
s=input()
k=int(input())
key=s[k-1]
ans=""
for i in range(len(s)):
  if s[i]==key:
    ans+=key
  else:
    ans+="*"
print(ans)
Buggy code:
K = int(input())
target = S[K-1]
result = []
result2 = ''
for i in S:
    if i is target:
        result.append(i)
    else:
        result.append('*')
for i in result:
    result2 += i

print(result2)

Fixed code:
N = int(input())
S = input()
K = int(input())
target = S[K-1]
result = []
result2 = ''
for i in S:
    if i is target:
        result.append(i)
    else:
        result.append('*')
for i in result:
    result2 += i

print(result2)
Buggy code:
N = int(input())
S = input()
K = int(input())

k = S[K-1]

print(k)

ans = []

for i in S:
    if i == k:
        ans.append(k)
    else:
        ans.append('*')

print(''.join(ans))

Fixed code:
N = int(input())
S = input()
K = int(input())

k = S[K-1]

ans = []

for i in S:
    if i == k:
        ans.append(k)
    else:
        ans.append('*')

print(''.join(ans))
Buggy code:
N=input()
S=input()
K=input()
C=S[K-1]
S_=''
for c in S:
  if c == C:
    S_+=c
  else:
    S_+="*"
print(S_)

Fixed code:
N=int(input())
S=input()
K=int(input())
C=S[K-1]
S_=''
for c in S:
  if c == C:
    S_+=c
  else:
    S_+="*"
print(S_)
Buggy code:
if __name__ == '__main__':
	N = int(input())
	S = input()
	K = int(input())
	token = S[K]
	ans = ''
	for i in range(N):
		if(S[i] != token):
			ans+='*'
		else:
			ans+=S[i]

	print(ans)

Fixed code:
if __name__ == '__main__':
	N = int(input())
	S = input()
	K = int(input())
	token = S[K-1]
	ans = ''
	for i in range(N):
		if(S[i] != token):
			ans+='*'
		else:
			ans+=S[i]

	print(ans)
Buggy code:
N = input()
S = input()
K = int(input())

target = S[K-1]
result = "*"
for i in S:
    if target == i:
        result += i
    else:
        result += '*'

print(result)




Fixed code:
N = input()
S = input()
K = int(input())

target = S[K-1]
result = ""
for i in S:
    if target == i:
        result += i
    else:
        result += '*'

print(result)
Buggy code:
N = int(input())
S = input()
K = input()
t = S[K-1]
ans = ''
for s in S:
  if s == t:
    ans += s
  else:
    ans += '*'

print(ans)

Fixed code:
N = int(input())
S = input()
K = int(input())
t = S[K-1]
ans = ''
for s in S:
  if s == t:
    ans += s
  else:
    ans += '*'

print(ans)
Buggy code:
n=int(input())
s=input()
k=int(input())
for i in range(n):
    if s[i] == s[k]:
        print(s[i],end="")
    else:
        print("*",end="")

Fixed code:
n=input()
s=input()
k=int(input())
for i in range(int(n)):
    print(s[i] if s[k-1] == s[i] else "*",end="")
print()
Buggy code:
N = int(input())
S = input()
K = int(input())
skey = S[K-1]
t = ""
for s in S:
  if s == skey:
    t += "*"
  else:
    t += s
print(t)

Fixed code:
N = int(input())
S = input()
K = int(input())
skey = S[K-1]
t = ""
for s in S:
  if s != skey:
    t += "*"
  else:
    t += s
print(t)
Buggy code:
N = int(input())
S = list(input())
K = int(input())

for i in range(N):
    if S[i] != S[K]:
        S[i] = "*"

print("".join(S))

Fixed code:
N = int(input())
S = list(input())
K = int(input())

for i in range(N):
    if S[i] != S[K-1]:
        S[i] = "*"

print("".join(S))
Buggy code:
N = int(input())
S = list(input())
K = int(input())

x = S[K-1]
s = [i for i, t in enumerate(S) if t == x]

for i in range(N):
	if i in s:
		S[i-1] = '*'
	else:
		pass

A = "".join(S)
print(A)

Fixed code:
N = int(input())
S = list(input())
K = int(input())

x = S[K-1]
s = [i for i, t in enumerate(S) if t == x]

for i in range(N):
	if i not in s:
		S[i] = '*'
	else:
		pass

A = "".join(S)
print(A)
Buggy code:
import copy 

n = int(input())
s = list(input())
k = int(input())

ans = s
for i in range(n):
    if ans[i] != s[k]:
        ans[i] = '*'
print(''.join(ans))



Fixed code:
import copy 

n = int(input())
s = list(input())
k = int(input())

ans = s
for i in range(n):
    if ans[i] != s[k - 1]:
        ans[i] = '*'
print(''.join(ans))
Buggy code:
n=int(input())
s=list(input())
k=int(input())
l=s[k-1]
for i in range(n):
  if s[i]==l:
    s[i]="*"
print("".join(s))

Fixed code:
n=int(input())
s=list(input())
k=int(input())
l=s[k-1]
for i in range(n):
  if s[i]!=l:
    s[i]="*"
print("".join(s))
Buggy code:
n=int(input())
s=list(input())
k=int(input())
t=s[k-1]
print(t)
for i in range(len(s)):
    if s[i]!=t:
        s[i]="*"
print("".join(s))

Fixed code:
n=int(input())
s=list(input())
k=int(input())
t=s[k-1]
for i in range(len(s)):
    if s[i]!=t:
        s[i]="*"
print("".join(s))
Buggy code:
N=int(input())
S=str(input())
K=int(input())
s=list(S)
t=s[K]
a=''
for i in range(N):
  if s[i]!=t:
    s[i]='*'
  a+=s[i]
print(a)

Fixed code:
N=int(input())
S=str(input())
K=int(input())
s=list(S)
t=s[K-1]
a=''
for i in range(N):
  if s[i]!=t:
    s[i]='*'
  a+=s[i]
print(a)
Buggy code:
a = int(input())
b = list(input())
c = int(input())
for i in range(a):
  if b[i] != b[c]:
    b[i] = "*"
print("".join(b))
    


Fixed code:
a = int(input())
b = list(input())
c = int(input())
for i in range(a):
  if b[i] != b[c-1]:
    b[i] = "*"
print("".join(b))
Buggy code:
n = int(input())
s = str(input())
k = int(input())

s =list(s)

for i in range(n):
    if s[i] != s[k]:
        s[i] = '*'

print(''.join(s))

Fixed code:
n = int(input())
s = str(input())
k = int(input())

s =list(s)

for i in range(n):
    if s[i] != s[k-1]:
        s[i] = '*'

print(''.join(s))
Buggy code:
N = int (input ())
S = str (input ())
K = int (input ())

num = ord (S [N - 1])

for i in range (len (S)):
    if ord (S [i]) == num:
        print (S [i], end = '')
    else:
        print ('*', end = '')


Fixed code:
N = int (input ())
S = str (input ())
K = int (input ())

num = ord (S [K - 1])

for i in range (N):
    if ord (S [i]) == num:
        print (S [i], end = '')
    else:
        print ('*', end = '')
Buggy code:
N=int(input())
S=list(input())
K=int(input())
t=S[K-1]
for i in range(N):
  	if S[i]!=t:
      	S[i]="*"
print("".join(S))

Fixed code:
N = int(input())
S = list(input())
K = int(input())

keyword = S[K - 1]

for i in range(N):
    if S[i] != keyword:
        S[i] = '*'

print(''.join(S))
Buggy code:
input()
S=input()
k=int(input())
for s in S:
  print(s if s==S[k-1] else "*")

Fixed code:
input()
S = input()
k = int(input())
for s in S: print(s if s == S[k - 1] else "*", end="")
Buggy code:
N = int(input())
S = list(input())
K = int(input())

ok_str = S[K-1]
print(ok_str)

for i in range(N):
    if S[i] == ok_str:
        pass
    else:
        S[i] = '*' 

print(''.join(S))

Fixed code:
N = int(input())
S = list(input())
K = int(input())

ok_str = S[K-1]

for i in range(N):
    if S[i] == ok_str:
        pass
    else:
        S[i] = '*' 

print(''.join(S))
Buggy code:
length = int(input())
string = input()
K_str_id = int(input())

K_str = string[K_str_id - 1]

output = ""
for tmp_str in string:
    print(K_str, tmp_str)
    if tmp_str == K_str:
        output += tmp_str
    else:
        output += "*"
print(output)

Fixed code:
length = int(input())
string = input()
K_str_id = int(input())

K_str = string[K_str_id - 1]

output = ""
for tmp_str in string:
    if tmp_str == K_str:
        output += tmp_str
    else:
        output += "*"
print(output)
Buggy code:
n = int(input())
s =[input() for i in range(n)]
k = int(input())
for i in range(n):
    if s[i]  != s[k-1]:
        s[i] = '*'
print("".join(s))


Fixed code:
n = int(input())
s = list(input())
k = int(input())

t = s[k-1]
for i in range(n):
 if s[i] != t:
  s[i] = '*'

print(''.join(s))
Buggy code:
n = int(input())
s = input()
k = int(input())
l = []

for i in range(n):
    l += s[i]

for i in range(n):
    if l[k-1] != l[i]:
        l[i] = '*'

for i in range(n):
    a += ''.join(l[i])
    
print(a)

Fixed code:
n=int(input())
s=[a for a in input()]
k=int(input())
l=s[k-1]
for i in range(len(s)):
    if s[i] != l:
        s[i] = "*"
print(''.join(s))
Buggy code:
n = int(input())
string = input()
k = int(input())

key = string[k-1]

index_list = [i for i,letter in enumerate(string) if letter == key]

word = ["*" for i in range(len(string))]
for elem in index_list:
	print(elem)
	word[elem] = key

word = "".join(word)
print(word)

Fixed code:
n = int(input())
string = input()
k = int(input())

key = string[k-1]

index_list = [i for i,letter in enumerate(string) if letter == key]

word = ["*" for i in range(len(string))]
for elem in index_list:
	word[elem] = key

word = "".join(word)
print(word)
Buggy code:
n = int(input())
s = list(input())
k = int(input())
c = s[k-1]
for i in range(len(s)):
  if not s[i] == c:
    s[i] = c
print("".join(s))

Fixed code:
n = int(input())
s = list(input())
k = int(input())
c = s[k-1]
for i in range(n):
  if not s[i] == c:
    s[i] = '*'
print("".join(s))
Buggy code:
N=int(input())
S=list(input())
K=int(input())
word=S[K]
for i in range(len(S)):
    if S[i]!=word:
        S[i]='*'
print(''.join(S))

Fixed code:
N=int(input())
S=list(input())
K=int(input())
word=S[K-1]
for i in range(len(S)):
    if S[i]!=word:
        S[i]='*'
print(''.join(S))
Buggy code:
n=int(input())
s=input()
k=int(input())
a=s[k-1]
t=[]
for i in range(n):
    if(s[i] == a):
        t.append('*')
    else:
        t.append(s[i])
        continue
for j in range(n):
    print(t[j],end='')
print()

Fixed code:
n=int(input())
s=input()
k=int(input())
a=s[k-1]
t=[]
for i in range(n):
    if(s[i] == a):
        t.append(s[i])
    else:
        t.append('*')
        continue
for j in range(n):
    print(t[j],end='')
print()
Buggy code:
N = int(input())
S = input()
K = int(input())

for s in S:
  if s!=S[K-1]:
    s='*'

print(S)

Fixed code:
N = int(input())
S = input()
K = int(input())
T = ''

for s in S:
    if s != S[K-1]:
        s = '*'
    T += s
print(T)
Buggy code:
N = int(input())
S = input()
K = int(input())
print("".join([i for i in S if i==S[K-1] else "*"]))

Fixed code:
N = int(input())
S = input()
K = int(input())
print("".join([i if i==S[K-1] else "*" for i in S]))
Buggy code:
N =int(input())
S = list(input())
K = int(input())

for i in range(N):
    if S[i] == S[K]:
        pass
    else:
        S[i] = '*'

print(''.join(S))


Fixed code:
N =int(input())
S = list(input())
K = int(input())

for i in range(N):
    if S[i] == S[K-1]:
        pass
    else:
        S[i] = '*'

print(''.join(S))
Buggy code:
n = int(input())
string = input()
m = int(input())

target_word = string[m-1]

char_list = []

for i in range(n):
  if target_word == string[i]:
    char_list.append('e')
  else:
    char_list.append('*')
    
print(*char_list, sep = '')

Fixed code:
n = int(input())
string = input()
m = int(input())

target_word = string[m-1]

char_list = []

for i in range(n):
  if target_word == string[i]:
    char_list.append(target_word)
  else:
    char_list.append('*')
    
print(*char_list, sep = '')
Buggy code:
N = int(input())
S = str(input())
K = int(input())
ans = ""
for i in range(0, N):
    if(S[i] != S[K]):
        ans += "*"
    else:
        ans += S[K]
print(ans)


Fixed code:
N = int(input())
S = str(input())
K = int(input())
ans = ""
for i in range(0, N):
    if(S[i] != S[K-1]):
        ans += "*"
    else:
        ans += S[K-1]
print(ans)
Buggy code:
n = int(input())
s = input()
k = int(input())

ans = ""
for i in s:
	if i == s[k]:
    	ans += s[k]
	else:
    	ans += "*"
print(ans)

Fixed code:
n=int(input())
s=input()
k=int(input())
ans=''
for i in s:
  if i == s[k-1]:
    ans+=i
  else:
    ans+='*'
print(ans)
Buggy code:
# coding: utf-8
# Your code here!
N = int(input())
S = str(input())
K = int(input())
#rint(N,S,K)

WRITE = list(S)
CHARA = S[K]
#print(CHARA)

for i in range(N):
    if S[i] != CHARA:
        S = S[:i] + '*' + S[i+1:]

print(S)

Fixed code:
# coding: utf-8
# Your# coding: utf-8
# Your code here!
N = int(input())
S = str(input())
K = int(input())
#rint(N,S,K)
 
WRITE = list(S)
CHARA = S[K-1]
#print(CHARA)
 
for i in range(N):
    if S[i] != CHARA:
        S = S[:i] + '*' + S[i+1:]
 
print(S)
Buggy code:
n = int(input())
s = str(input())
k = int(input())
x = s[k-1]
ans = ""
print(x)
for i in range(n):
    if s[i] != x:
        ans += "*"
    if s[i] == x:
        ans += s[i]
print(ans)

Fixed code:
n = int(input())
s = str(input())
k = int(input())
x = s[k-1]
ans = ""
for i in range(n):
    if s[i] != x:
        ans += "*"
    if s[i] == x:
        ans += s[i]
print(ans)
Buggy code:
n=int(input())
s=input()
k=int(input())
s_=str()
for i in range(n):
  if s[i]!=s[k+1]:
    s_+='*'
  else:
    s_+=s[i]

Fixed code:
n=int(input())
s=input()
k=int(input())
s_=str()
for i in range(n):
  if s[i]!=s[k-1]:
    s_+='*'
  else:
    s_+=s[i]
print(s_)
Buggy code:
N = int(input())
S = list(input())
K = int(input())
K = S[K-1]
    
for i in range(N):
    if S[i] != K:
        S[i] = "*"
        
print(S)

Fixed code:
N = int(input())
S = input()
K = int(input())
K = S[K-1]
S = list(S)

for i in range(N):
    if S[i] != K:
        S[i] = "*"

S = "".join(S)
print(S)
Buggy code:
N = input()
S = input()
K = int(input())

tar = S[K-1]

lis = (_ if _==tar else "*" for _ in S]
print("".join(lis))

Fixed code:
N = input()
S = input()
K = int(input())

tar = S[K-1]

lis = (_ if _==tar else "*" for _ in S)
print("".join(lis))
Buggy code:
n = int(input())
s = input()
k = int(input())

exa = s[k-1]
for i in s:
    if i != exa:
        print(i,exa)
        s = s.replace(i,'*')
    
print(s)

Fixed code:
n = int(input())
s = input()
k = int(input())

exa = s[k-1]
for i in s:
    if i != exa:
        s = s.replace(i,'*')
    
print(s)
Buggy code:
n = int(input())
s = input()
k = int(input())
sa = s[k: k + 1]
sl = len(s)
sli = list(s)
hey = []
for sli in sli:
    if sli == sa:
        hey.append(sli)
    else:
        hey.append("*")
hey = "".join(hey)
print(hey)


Fixed code:
n = int(input())
s = input()
k = int(input())
sa = s[k - 1: k]
sl = len(s)
sli = list(s)
hey = []
for sli in sli:
    if sli == sa:
        hey.append(sli)
    else:
        hey.append("*")
hey = "".join(hey)
print(hey)
Buggy code:
n = int(input())
s = str(input())
k = int(input())

c = s[k]

out = ""

for i in s:
    if i == c:
        out += i
    else:
        out += "*"

print(out)

Fixed code:
n = int(input())
s = str(input())
k = int(input())-1

c = s[k]

out = ""

for i in s:
    if i == c:
        out += i
    else:
        out += "*"

print(out)
Buggy code:
N = int(input())
S = input()
K = int(input())
a = ""
b = S[K]
for i in range(N):
  a = S[i]
  if (a == b):
    print(a,end = "")
  else:
    print("*",end = "")

Fixed code:
N = int(input())
S = input()
K = int(input())
a = ""
b = S[K - 1]
for i in range(N):
  a = S[i]
  if (a == b):
    print(a,end = "")
  else:
    print("*",end = "")
Buggy code:
n = int(input())
s = input()
k = int(input())
for i in s:
    if i == s[k]:
        print(i, end="")
    else:
        print("*", end="")

Fixed code:
n = int(input())
s = input()
k = int(input())
for i in s:
    if i == s[k-1]:
        print(i, end="")
    else:
        print("*", end="")
Buggy code:
n = int(input())
s = input()
k = int(input())
result = []

for x in s:
    if x != s[k]:
        result.append("*")
    else:
        result.append(x)

print("".join(result))


Fixed code:
n = int(input())
s = input()
k = int(input())
result = []

for x in s:
    if x != s[k-1]:
        result.append("*")
    else:
        result.append(x)

print("".join(result))
Buggy code:
N = int(input())
S = list(input())
K = int(input())

for i in S:
    if S[K] == i:
        print(i, end="")
    else:
        print("*", end="")
print()

Fixed code:
N = int(input())
S = list(input())
K = int(input())
 
for i in S:
    if S[K-1] == i:
        print(i, end="")
    else:
        print("*", end="")
print()
Buggy code:
N = int(input())
S = input()
K = int(input())
flag = S[K]
ans = []
for x in S:
    if x == flag:
        ans.append(x)
    else:
        ans.append('*')
print(''.join(ans))


Fixed code:
N = int(input())
S = input()
K = int(input())
flag = S[K-1]
ans = []
for x in S:
    if x == flag:
        ans.append(x)
    else:
        ans.append('*')
print(''.join(ans))
Buggy code:
N=input()
S=input()
K=int(input())
count=0
for s in S:
    if s==S[k]:
        pass
    else:
        S=S[:count] + '*' + S[count+1:]
    count+=1
print(S)

Fixed code:
N=int(input())
S=input()
K=int(input())
count=0
for s in S:
    if s==S[K-1]:
        pass
    else:
        S=S[:count] + '*' + S[count+1:]
    count+=1
print(S)
Buggy code:
import sys
input=sys.stdin.readline

N=int(input())
S=input()
K=int(input())-1
for s in S:
  if s != S[K]:
    print("*",end='')
  else:
    print(s,end='')
print()

Fixed code:
import sys
input=sys.stdin.readline
 
N=int(input())
S=input()[:-1]
K=int(input())-1
for s in S:
  if s != S[K]:
    print("*",end='')
  else:
    print(s,end='')
print()
Buggy code:
N = int(input())
S = input()
K = int(input())

a = S[N-1]
for i in S:
    if i != a:
        print('*',end='')
    if i == a:
        print(i,end='')

Fixed code:
N = int(input())
S = input()
K = int(input())

a = S[K-1]
for i in S:
    if i != a:
        print('*',end='')
    else:
        print(i,end='')
Buggy code:
n = int(input())
s = input()
k = int(input())

s = list(map(lambda x: '*' if x != s[k] else x, s))

print(*s, sep='')


Fixed code:
n = int(input())
s = input()
k = int(input()) - 1

s = list(map(lambda x: '*' if x != s[k] else x, s))

print(*s, sep='')
Buggy code:
A = int(input())
B = input()
k = int(input())
for v in B:
    print(B if k[k-1] == B else "*",end="")

Fixed code:
input()
B = input()
k = int(input())
for v in B:
    print(v if B[k-1] == v else "*",end="")
Buggy code:
N = int(input())
S = input()
K = int(input())
ans = ""
for i in range(N):
    ans += "*" S[i] != S[K-1] else S[i]
print(ans)

Fixed code:
N = int(input())
S = input()
K = int(input())
ans = ""
for i in range(N):
    ans += "*" if S[i] != S[K-1] else S[i]
print(ans)
Buggy code:
N = int(input())
S = input()
K = int(input())
t = S[K+1]
ans = ""
for s in S:
  if s == t:
    ans += s
  else:
    ans += "*"
print(ans)

Fixed code:
N = int(input())
S = input()
K = int(input())
ans = ''
for s in S:
    if s == S[K-1]: ans += s
    else: ans += '*'
print(ans)
Buggy code:
a = int(input())
s = input()
k = int(input())

t = ["*"]*a
aa = s[k]
for f,i in enumerate(s):
  if i == aa:
    t[f] = i
print(" ".join(aa))


Fixed code:

a = int(input())
s = input()
k = int(input())

t = ["*"]*a
aa = s[k-1]
for f,i in enumerate(s):
  if i == aa:
    t[f] = i
print("".join(t))
Buggy code:
def eee(s,k):
    a = s[k-1]
    k = list(filter(lambda x:x!=a,s))
    z = ''.join(s)
    for i in k:
        print(k)
        z = z.replace(i,'*')
        print(z)
    return z

n = int(input())
s = list(input())
k = int(input())
print(eee(s,k))

Fixed code:
def eee(s,k):
    a = s[k-1]
    k = list(filter(lambda x:x!=a,s))
    z = ''.join(s)
    for i in k:
        z = z.replace(i,'*')
    return z

n = int(input())
s = list(input())
k = int(input())
print(eee(s,k))
Buggy code:
S = int(input())
word = list(input())
K = int(input())
judge=word[K-1]
for i in range(S):
    if word[i] != judge:
        word[i] = "*"
print(" ".join(word))

Fixed code:
S = int(input())
word = list(input())
K = int(input())

judge=word[K-1]
for i in range(S):
    if word[i] != judge:
        word[i] = '*'
print("".join(word))
Buggy code:
N = int(input())
S = input()
K = int(input())
list = []
Sk = S[K-1]
for i range(0,N):
  s = S[i]
  s_ans = Sk if s == Sk else "*"
  list.append(s_ans)
ans = join(list)
print(ans)


Fixed code:
N = int(input())
S = input()
K = int(input())
list = []
Sk = S[K-1]
for i in range(0,N):
  s = S[i]
  s_ans = Sk if s == Sk else "*"
  list.append(s_ans)
ans = "".join(list)
print(ans)
Buggy code:
# -*- coding: utf-8 -*-
n = int(input())
s = input()
k = int(input())

selected = s[k]
print(''.join(['*' if l != selected else l for l in s ]))

Fixed code:
# -*- coding: utf-8 -*-
n = int(input())
s = input()
k = int(input())

selected = s[k - 1]
print(''.join(['*' if l != selected else l for l in s ]))
Buggy code:
n = int(input())
s = input()
k = int(input())
for i in range(len(s)):
  if s[i] != s[k-1]:
    s[i] = "*"
print(s)


Fixed code:
n=int(input())
s=input()
k=int(input())

for i in range(n):
    if s[i] != s[k-1]:
        s=s[:i]+'*'+s[i+1:]

print(s)
Buggy code:
N=int(input())
S=input()
K=int(input())
letter=""

for i in S:
    if i is S[K]:
        letter +=i
    else:
        letter +="*"
print(letter)


Fixed code:

N=int(input())
S=input()
K=int(input())
letter=""

for i in S:
    if i is S[K-1]:
        letter +=i
    else:
        letter +="*"
print(letter)
Buggy code:
N = int(input())
S = list(input())
K = int(input())
tag = S[K - 1]
for i in range(N):
    if S[i] == tag:
        continue
    else:
        S[i] == "*"
print("".join(S))


Fixed code:
N = int(input())
S = list(input())
K = int(input())
tag = S[K - 1]
for i in range(N):
    if S[i] == tag:
        continue
    else:
        S[i] = "*"
print("".join(S))
Buggy code:
# -*- coding: utf-8 -*-
N = int(input())
S = list(str(input()))
K = int(input())

for i in range(N):
    if S[i] != S[K]:
        S[i] = "*"
"".join(S)
print(S)


Fixed code:
# -*- coding: utf-8 -*-
N = int(input())
S = list(str(input()))
K = int(input())

for i in range(N):
    if S[i] != S[K - 1]:
        S[i] = "*"

Z = ''.join(S)
print(Z)
Buggy code:
N = int(input())
S = list(input())
K = int(input())

a = S[K]

for i in range(N):
    if S[i] != a:
        S[i] = "*"

print(''.join(S))

Fixed code:
N = int(input())
S = list(input())
K = int(input())

a = S[K-1]

for i in range(N):
    if S[i] != a:
        S[i] = "*"

print(''.join(S))