Problem:


Score : 200 points

Problem Statement

You are given a string S of length N consisting of lowercase English letters, and an integer K.
Print the string obtained by replacing every character in S that differs from the K-th character of S, with *.

Constraints

1 \leq K \leq N\leq 10

S is a string of length N consisting of lowercase English letters.

N and K are integers.

Input

Input is given from Standard Input in the following format:

N
S
K

Output

Print the string obtained by replacing every character in S that differs from the K-th character of S, with *.

Sample Input 1

5
error
2

Sample Output 1

*rr*r

The second character of S is r. When we replace every character in error that differs from r with *, we get the string *rr*r.

Sample Input 2

6
eleven
5

Sample Output 2

e*e*e*

Sample Input 3

9
education
7

Sample Output 3

******i**



Sample input:
5
error
2


Sample output:
*rr*r

Submission status: Accepted

Solution code:
al = {"a":"*","b":"*","c":"*","d":"*","e":"*","f":"*","g":"*","h":"*","i":"","j":"*","k":"*","l":"*","m":"*","n":"*","o":"*","p":"*","q":"*","r":"*","s":"*","t":"*","u":"*","v":"*","w":"*","x":"*","y":"*","z":"*"}
N = int(input())
S = input()
K = int(input())
del al[S[K-1]]
print(S.translate(str.maketrans(al)))

Submission status: Accepted

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

letter = s[k-1]
out = ''

for i in range(n):
    if s[i] == letter:
        out += s[i]
    else:
        out += '*'

print(out)

Submission status: Accepted

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

target = S[K-1]
result = ""

for i in S:
    if i == target:
        result += i
    else:
        result += "*"

print(result)

Submission status: Accepted

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


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

for i in s:
    print(i,end="")

Submission status: Accepted

Solution code:
N = int(input())
s = input()
S = [str(c) for c in s]
K = int(input())

for i in range(N):
    if str(S[i]) != str(S[K-1]):
        S[i] = "*"
i=0
for i in range(N):
    print(S[i], end="")

Submission status: Accepted

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

s = S[K-1]
list_S = list(S)

for i in range(N):
    if list_S[i] != s:
        list_S[i] = '*'

ans = "".join(list_S)
print(ans)

Submission status: Accepted

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

a = S[K - 1]

for i in range(len(S)) :
    if S[i] != a :
        print('*', end="")
    else :
        print(S[i], end="")
print()

Submission status: Accepted

Solution code:
N = int(input())
S = input()
K = int(input())
k_string = S[K-1:K]
i_string = 0
for i in range(N):
    i_string = S[i:i+1]
    if i_string != k_string:
        S = S.replace(i_string, "*")

print(S)

Submission status: Accepted

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

No_change=S[K-1]

out=[]
for s in S:
  s_temp=s
  if s != No_change:
    s_temp='*'
  out.append(s_temp)
  
out_str=''
for o in out:
  out_str+=o
  
print(out_str)

Submission status: Accepted

Solution code:
n = int(input())
s = input()
k = int(input())
str = []

for i in range(n):
    if(s[i] != s[k-1]):
        str.append("*")
    else:
        str.append(s[i])

print("".join(str))

Submission status: Accepted

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

t = S[K-1]
tl = set(list(S))
ans = S
for n in tl:
  if n != t:
    ans = ans.replace(n, "*")
print(ans)

Submission status: Accepted

Solution code:
n = int(input().strip())
s = input().strip()
k = int(input().strip())

str= list(s)
target = str[k-1]

for i in range(n):
  if str[i] != target:
    str[i] = "*"

s_c = "".join(str) 

print(s_c)

Submission status: Accepted

Solution code:
N = input()
S = input()
K = input()

targetalpha = S[int(K)-1]
S_list = list(S)

for i in range(0,int(N)):
  if(S_list[i] != targetalpha):
    S_list[i] = "*"
  
S = "".join(S_list)
print(S)

Submission status: Accepted

Solution code:
import sys

n = int(sys.stdin.readline())
s = sys.stdin.readline()
k = int(sys.stdin.readline())

ch = s[k - 1:k]
ans = ''
for i in range(n):
    tmp = s[i:i + 1]
    if tmp in list(ch):
        ans += tmp
    else:
        ans += '*'
print(ans)

Submission status: Accepted

Solution code:
n = input() # len
s = input() # str
k = input() # index

tmp = s[int(k)-1]
ret = ""
for i in range(int(n)):
    if not s[i] == tmp:
        ret+='*'
    else:
        ret+=s[i]

print(ret)

Submission status: Accepted

Solution code:
import re

N=int(input())
S=input()
K=int(input())
regex="[^"+S[K-1]+"]"
ans=re.sub(regex,"*",S)
print(ans)

Submission status: Accepted

Solution code:

def main():
    C=[]
    for i in range(3):
        C.append((input()))

    line = list(C[1])

    for i in range(int(C[0])):
        if line[i] != line[int(C[2])-1]:
            line[i] = "*"

    ans = ""
    for i in line:
        ans +=i

    return ans

print(main())

Submission status: Accepted

Solution code:
n=int(input())
s=input()
k=int(input())
t=s[k-1]
ans=""
for i in s:
    if i!=t:
        ans+="*"
    else:
        ans+=t
print(ans)

Submission status: Accepted

Solution 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))

Submission status: Accepted

Solution code:
n = int(input())
s = input()
k = int(input()) - 1
ans = ''
for i in range(n):
  if s[i] == s[k]:
    ans = ans + s[k]
  else:
    ans = ans + '*'
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
S = input()
K = int(input())
point = S[K-1]
word = ''
for i in range(N):
  if S[i] == point:
    word += S[i]
  else:
    word += '*'
print(word)

Submission status: Accepted

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

target_char = S[K-1]
for num in range(N):
    if S[num] != target_char:
        S = S[:num] + '*' + S[num + 1:]

print(S)

Submission status: Accepted

Solution code:
#改行入力
N = input()
S = input()
K = int(input())

x = S[K-1]

for i in range(len(S)):
    if S[i] != x:
        S = S.replace(S[i], '*')



print(S)

Submission status: Accepted

Solution 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] = "*"
s = "".join(S)
print(s)

Submission status: Accepted

Solution code:
N = int(input())
S = input()
K = int(input())
res = ""
a = S[K - 1]
for i in range(N):
    if S[i] != a:
        res += "*"
    else:
        res += S[i]
print(res)

Submission status: Accepted

Solution code:
from sys import stdin
input=[]
for i in range(3):
    input.append(stdin.readline().rstrip())

input[0]=int(input[0])
input[2]=int(input[2])
flag=input[1][input[2]-1]
output=""
for i in range(input[0]):
    if input[1][i]!=flag:
        #input[1][i]="*"
        output+="*"
    else:
        output+=flag
print(output)

Submission status: Accepted

Solution code:
n = int(input())
s = input().rstrip()
k = int(input())

c = s[k - 1]
r = []
for letter in list(s):
    e = '*' if letter is not c else c
    r.append(e)

print(''.join(r))

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import numpy as np
import scipy as sp

def main():
    while True:
        try:
            il = [input() for i in range(3)]
            N = int(il[0])
            S = il[1]
            K = int(il[2])

            res = ''.join(['*' if s != S[K-1] else s for s in S])

            print(res)


        except:
            break

if __name__ == '__main__':
    main()

Submission status: Accepted

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

char = S[K-1]
string = []
for i in S:
  if (i == char):
    string.append(i)
  else:
    string.append("*")
result = ''.join(string)
print(result)

Submission status: Accepted

Solution code:
n = int(input())
s = input().rstrip()
k = int(input())

key = s[k-1]

for x in s:
    if x != key:
        s = s.replace(x, '*')
        
print(s)

Submission status: Accepted

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

tmp_string = s[k - 1]

for c in s:
    if c == tmp_string:
        print(tmp_string, end="")
    else:
        print("*", end="")
print()

Submission status: Accepted

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

chk1 = s[k-1]

for i in range(len(s)):
    if s[i] != chk1:
        chk2 = s[i]
        s = s.replace(chk2,"*")
        
print(s)

Submission status: Accepted

Solution code:
n = int(input())
s = input()
k = int(input())
ans = ""
for i in s :
	if i == s[k-1] :
		ans += s[k-1]
	else :
		ans += "*"
print (ans)

Submission status: Accepted

Solution code:
N = int(input())
S = input()
K = int(input())
S = list(S)
t = S[K-1]
U = [s if s == t else '*' for s in S]
U = ''.join(U)
print(U)

Submission status: Accepted

Solution code:
N = int(input())
S = input()
K = int(input())
a = S[K-1]
for i in range(N):
  if S[i] != a:
    S = S.replace(S[i], '*')
    
print(S)

Submission status: Accepted

Solution code:
import re
N = int(input())
s = input()
index = int(input())-1

ss = s[index]
ans = s
for ii, i in enumerate(s):
  if i != ss:
    ans = ans.replace(i, '*')
print(ans)

Submission status: Accepted

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

char = S[K - 1]
rst = ""
for s in S : 
    if s == char : 
        rst += s
    else : 
        rst += "*"
print(rst)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n=int(input())
s=list(str(input()))
k=int(input())

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

Submission status: Accepted

Solution code:
a = int(input())
word = input()
b = int(input())
c = []
d = ""
for i in range(a):
  if word[i] != word[b-1]:
    c.append("*")
  else:
    c.append(word[i])
for i in range(a):
  d += c[i]
print(d)

Submission status: Accepted

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

sk = S[K-1]

result = []
for s in S:
	if s != sk:
		result.append("*")
	else:
		result.append(s)
 
print("".join(result))

Submission status: Accepted

Solution code:
n = int(input())
s = input()
k = s[int(input()) - 1]

for i in s:
    if i != k:
        print('*', end='')
    else:
        print(i, end='')

print()

Submission status: Accepted

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

s = S[K-1]
lett = ""

for i in range(N):
	if S[i] == s:
		lett += s
	else:
		lett +=("*")

print(lett)

Submission status: Accepted

Solution code:
N = int(input())
S = input().rstrip()
K = int(input())
str_k = S[K-1:K]

result = ""
for s in S:
    if s != str_k:
        result += '*'
    else:
        result += s

print(result)

Submission status: Accepted

Solution code:
length=int(input())
string=list(input())
K=int(input())

key=string[K-1]

for i in range(length):
    if key != string[i]:
        string[i] = "*"
        
for j in range(length):
    print(string[j],end="")

Submission status: Accepted

Solution code:
N=input()
s=input()
k=input()

N=int(N)
k=int(k)

ward=s[k-1]

for i in range(len(s)):
    if(s[i]==ward):
        print(ward ,end="")
    else:
        print("*" ,end="")
print("")

Submission status: Accepted

Solution code:
n = int(input())
s = list(input())
k = int(input())
change_c = s[k-1]
for i in range(n):
    if s[i] != change_c:
        s[i] = '*'

ans = ''.join(s)
print(ans)

Submission status: Accepted

Solution code:
# /usr/bin/python
# -*- coding: utf-8 -*-
import sys
import math


n = int(input())
s = str(input())
k = int(input())
ans = ""
for c in s:
  if c == s[k-1]:
    ans += c
  else:
    ans += "*"
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

n = int(input())

s = input()

k = int(input())

s1 = s[k-1]

for i in s:
    if i == s1:
        print(i, end='')
    else:
        print('*', end='')

Submission status: Accepted

Solution code:
N = int(input())
S = str(input().strip())
K = int(input())
ret = []
target_char = S[K-1]
for char in S:
    if char == target_char:
        ret.append(target_char)
    else:
        ret.append("*")
print("".join(ret))

Submission status: Accepted

Solution code:
n = int(input())
tmp = input()
s = list(tmp)
k = int(input())
for i in range(len(s)):
    if s[k-1] != s[i]:
        print('*',end='')
    else:
        print(s[k-1],end='')
print()

Submission status: Accepted

Solution code:
n=int(input())
s=input()
k=int(input())
for i in range(n):
    if s[k-1] != s[i]:
        s = s.replace(s[i],"*")
print(s)

Submission status: Accepted

Solution code:
N = int(input())
S = list(input())
K = int(input())
a = S[K - 1]
for i in range(len(S)):
    if (S[i] != a):
        S[i] = "*"
print("".join(S))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
 
N = int(input())
S = input()
K = int(input())
 
result = ''
sk = S[K-1]

for s in S:
	if sk == s:
		result += s
	else:
		result += '*'
 
print(result)

Submission status: Accepted

Solution code:
n = int(input())
s = list(input().strip())
k = int(input())-1
for i, v in enumerate(s):
    if s[i] != s[k]:
        s[i] = '*'

print("".join(s))

Submission status: Accepted

Solution code:
N = int(input())
S = input()
K = int(input())
S = list(S)
text = S[K-1]
for i in range(N):
    if text != S[i]:
        S[i] = '*'

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

Submission status: Accepted

Solution code:
N = int(input())
S = input()
K = int(input())
l = []
for i in S:
    if i == S[K-1]:
        l.append(i)
    else:
        l.append('*')

print(''.join(l))

Submission status: Accepted

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

ans = ""

for char in S:
    ans += c if char == c else "*"

print(ans)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
b=input()
s=input()
n=int(input())-1
a=s[n]
ans=""
#print(a)
for i in range(len(s)):
    m=s[i]
    if(s[i]!=a):
        m="*"
    ans+=m
print(ans)

Submission status: Accepted

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

target = S[K-1]


s = list(S)
for index in range(len(s)):
    if s[index] != target:
        s[index] = '*'

print("".join(s))

Submission status: Accepted

Solution code:
n = int(input())
char = input()
k = int(input()) - 1

char_list = list(char)

replace = char_list[k]

result = ""

for i in char_list:
    if i==replace:
        result += replace
    else:
        result += "*"

print(result)

Submission status: Accepted

Solution code:

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

p = s[k-1]
out = ""
for c in s:
	if(c == p):
		out += c
	else:
		out += "*"

print(out)

Submission status: Accepted

Solution code:
n = int(input())
s_ = input()
k = int(input()) - 1

ans = ''
for i, s in enumerate(s_):
    if s != s_[k]:
        ans += '*'
    else:
        ans += s
print(ans)

Submission status: Accepted

Solution code:
N=int(input())
S=input()
K=int(input())
re=S[K-1]
for i in range(N):
    if(S[i]!=re):
        S=S[:i]+'*'+S[i+1:]
print(S)

Submission status: Accepted

Solution code:
a=input()
b=input()
c=input()
a=int(a)
c=int(c)
x=b[c-1]
    
ll=list()
for i in b:
    if i == x:
        ll.append(i)
    else:
        ll.append("*")
for i in ll:
    print(i, end="")

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    N = int(input())
    S = str(input())
    K = int(input())

    replace_str = S[K-1]
    list_S = list(S)

    for i in range(0, N):
        if list_S[i] == replace_str:
            continue
        else:
            list_S[i] = "*"

    answer = "".join(list_S)
    print(answer)

Submission status: Accepted

Solution code:
import re
import string
import sys
from itertools import product

import numpy as np

sys.setrecursionlimit(200000)


def input():
    return sys.stdin.readline()[:-1]


def ii(t: type = int):
    return t(input())


def il(t: type = int):
    return list(map(t, input().split()))


def imi(N: int, t: type = int):
    return [ii(t) for _ in range(N)]


def iml(N: int, t: type = int):
    return [il(t) for _ in range(N)]


def solve():
    N = ii()
    S = ii(str)
    K = ii()
    a = S[K - 1]
    for s in string.ascii_lowercase:
        if s == a:
            continue
        S = S.replace(s, "*")
    return S


if __name__ == "__main__":
    print(solve())

Submission status: Accepted

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

s = list(S)

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

S = "".join(s)

print(S)

Submission status: Accepted

Solution code:
N = int(input())
S = str(input())
K = int(input())
c = S[K-1]
re = ""
for i in S:
    if i != c:
        re+="*"
    else:
        re+=i
print(str(re))

Submission status: Accepted

Solution code:
N = int(input())
S = input()
K = int(input())
 
ans = ""
for c in S:
    if S[K-1] != c:
        ans += '*'
    else:
        ans += c
 
print(ans)

Submission status: Accepted

Solution 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()

Submission status: Accepted

Solution 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))

Submission status: Accepted

Solution 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()

Submission status: Accepted

Solution code:
n = int(input())
st = input().strip()
m = int(input())
d = st[m-1]
for i in range(n):
  if st[i] != d:
    print('*',end='')
  else:
    print(d, end='')

Submission status: Accepted

Solution code:
n = int(input())
s = list(input())
k = int(input())
q = ''
ans = s[k-1]
for i, w in enumerate(s):
    if not w == ans:
        s[i] = '*'

for x in s:
    q += x
print(q)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())
s = list(str(input()))
k = int(input())
t = s[k-1]
for i in range(n):
  if s[i] == t:
    s[i] = s[i]
  else:
    s[i] = "*"
answer = ""
for i in range(n):
  answer = answer + s[i]
print(answer)

Submission status: Accepted

Solution code:
N= int(input())
moji = list(input())
K= int(input())
S=moji[K-1]
for i in range(N):
    if(moji[i]==S):
        pass
    else:
        moji[i]="*"
moji2=str("".join(moji))
print(moji2)

Submission status: Accepted

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

s = list(S)
s1 = s[K-1]
for i in range(N):
    if s[i] != s1:
        S = S.replace(s[i], "*")

print(S)

Submission status: Accepted

Solution code:
n=int(input())
a=list(input())
k=int(input())

s=a[k-1]

for i in range(n):
  if a[i] != s:
    a[i] = "*"
 
print("".join(a))

Submission status: Accepted

Solution code:
a = [input() for i in range(3)]
t = a[1][int(a[2]) - 1]
for c in a[1]:
    print(c if c == t else '*', end='')

Submission status: Accepted

Solution code:
n = input()
s = input()
k = input()
kaeru = s[int(k)-1]
dst = ""
for i in range(int(n)):
    if s[i]!=kaeru:
        dst = dst + "*"
    else:
        dst = dst + s[i]
print(dst)

Submission status: Accepted

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

S_list = [S[i] for i in range(len(S))]

kekka = ""
for x in S_list:
    if x!=S[K-1]:
        kekka += "*"
    else :
        kekka += S[K-1]


print(kekka)

Submission status: Accepted

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

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

print(''.join(S))

Submission status: Accepted

Solution code:
n = int(input())
s = input()
k = int(input())
moji = s[k-1]
print(''.join(['*' if item != moji else item for item in s]))

Submission status: Accepted

Solution code:
from sys import stdin
N = int(stdin.readline().rstrip())
S = stdin.readline().rstrip()
K = int(stdin.readline().rstrip())

chr = S[K-1]
ans = S
for c in range(0,N):
    if S[c] != chr:
        ans = ans.replace(S[c],'*')
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
s = input()
k = int(input())
s_k = s[k-1]
for i in range(N):
  if s[i] != s_k:
    s = s[:i] + '*' + s[i+1:]
print(s)

Submission status: Accepted

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

a = s[k-1]

for i in range(n):
    if s[i] != a:
        print('*',end='')
    else:
        print(s[i],end='')

print()

Submission status: Accepted

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

s = S[K - 1]
answer = []
for i, c in enumerate(S):
    if c != s:
        answer.append('*')
    else:
        answer.append(c)

print(''.join(answer))

Submission status: Accepted

Solution code:
n = int(input())
s =input()
k =int(input())
t = s[k - 1]
p = ""
for i in range(n):
    if s[i] != t:
        p += "*"
    else:
        p += s[i]
print(p)

Submission status: Accepted

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

s = list(S)

t = s[K - 1]

i = 0
for c in s:
    if t != c:
        s[i] = '*'
    i += 1

print(''.join(s))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())
s = input()
k = int(input())
ans = []
val = s[k-1]
for i in range(n):
    if s[i] != val:
        ans.append("*")
    else:
        ans.append(s[i])
a = ''.join(ans)
print(a)

Submission status: Accepted

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

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

print(s)

Submission status: Accepted

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

mask = S[K-1]

ret = []
for s in S:
  if s == mask:
    ret.append(s)
  else:
    ret.append('*')

print(''.join(ret))

Submission status: Accepted

Solution code:
n = int(input())
s = input()
k = int(input())
ans = ''
for i in s:
    ans += '*' if not s[k-1] == i else i

print(ans)

Submission status: Accepted

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

ans = ['*'] * len(s)
replace = s[k-1]

for i in range(len(s)):
  if s[i] == replace:
    ans[i] = replace
print("".join(ans))

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    n = int(input())
    s = input()
    k = int(input())
    sk = s[k-1]
    anslst = []
    for i in s:
        if sk != i:
            anslst.append("*")
        else:
            anslst.append(sk)
    for a in anslst:
        print(a, end="")
    print("\n")

Submission status: Accepted

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

ans = ''.join(['*' if s!= S[K-1] else s for s in S])
print(ans)

Submission status: Accepted

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

target = s[k-1]
ans = ''
for i in s:
  if i == target:
    ans += i
  else:
    ans += '*'
print(ans)

Submission status: Accepted

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

target = S[K-1]

ans = ''

for c in S:
    if c != target:
        ans += '*'
    else:
        ans += target

print(ans)

Submission status: Accepted

Solution code:
# coding: utf-8
def main():
    n = int(input())
    s = list(input())
    k = int(input())

    c = s[k-1]
    for i, _ in enumerate(s):
        s[i] = "*" if s[i] != c else s[i]

    return "".join(s)


print(main())

Submission status: Accepted

Solution code:
N = int(input())
S = input()
K = int(input())
temp = S[K - 1]
c_list = list(S)
for i in range(N):
    if temp != c_list[i]:
        c_list[i] = "*"
print("".join(c_list))

Submission status: Accepted

Solution code:
n = int(input())
s = list(input())
c = int(input())
for i in range(0,n):
  if s[i] == s[c-1]:
    continue
  else:
    s[i] = '*'
    
str = ''.join(s)

print(str)

Submission status: Accepted

Solution code:
N = input()
S = input()
K = input()
result = []

target = S[int(K) - 1]

stringlist = list(S)
for i in stringlist:
    if target != i:
        result.append("*")
    else:
        result.append(i)

print("".join(result))

Submission status: Accepted

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

focus=s[k-1]
ans=""


for str_k in s:
  if str_k==focus:
    ans=ans+str_k
  else:
    ans=ans+"*"
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
S = (input())
K = int(input())
s=[]
s1=""
for i in range(N):
    if S[i]==S[K-1]:
        s.append(S[i])
    else:
        s.append("*")
for i in range(N):
    s1 += s[i]
print(s1)

Submission status: Accepted

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


tgt = S[K-1]
res = []
for c in S:
    if c == tgt:
        res.append(c)
    else :
        res.append('*')
print(''.join(res))

Submission status: Accepted

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

e = s[k-1]

res = ''
for c in s:
    if c != e:
        res += '*'
    else:
        res += e

print(res)

Submission status: Accepted

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

c = s[k - 1]
ans_list = ["*" if i != c else i for i in s]
ans = ""
ans = ans.join(ans_list)
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
s = input()
k = int(input()) - 1
a = ""
for i in range(n):
  if s[i] != s[k]:
    a = a +"*"
  else:
    a = a + s[i]
print(a)

Submission status: Accepted

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

news=[]

tar = s[k-1]
for i in range(n):
    if s[i]!=tar:
        news += "*"
    else:
        news += s[i]

ans = ""        
for i in news:
    ans += i

print(ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

import sys

debug = False

def log(text):
    if debug:
        print(text)

def parse_input(lines_as_string = None):

    global debug
    lines = []
    if lines_as_string is None:
        debug = False
        lines.append(input())
        lines.append(input())
        lines.append(input())
    else:
        debug = True
        lines = [e for e in lines_as_string.split("\n")][1:-1]


    n = int(lines[0])
    s = lines[1]
    k = int(lines[2])

    return (n, s, k)


def solve(n, s, k):


    c = s[k-1]

    result = []
    for d in s:
        if c == d:
            result.append(c)
        else:
            result.append("*")

    return "".join(result)


def main():
    # 出力

    print("%s" % solve(*parse_input()))

if __name__ == '__main__':

    main()

Submission status: Accepted

Solution code:
import re
input()
s = input()
l = s[int(input())-1]
pat = '[^{}]'.format(l)
x = re.sub(pat, '*',  s)
print(x)

Submission status: Accepted

Solution code:
import re

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

target = s[k-1]
print(re.sub('[^' + s[k-1] + ']', '*', s))

Submission status: Accepted

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

a = s[k-1]
li = []
s2 = ''

for i in range(n):
    if s[i] != a:
        li.append(i)

for i in range(n):
    if i in li:
        s2 = s2 + '*'
    else:
        s2 = s2 + s[i]

print(s2)

Submission status: Accepted

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

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

Submission status: Accepted

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

for i in range(len(s)):
    if s[i] != s[k - 1]:
        s[i] = "*"
ans = "".join(s)
print(ans)

Submission status: Accepted

Solution 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()

Submission status: Accepted

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

t = S[K - 1]

ans = ''
for i in S:
    if i == t:
        ans += i
    else:
        ans += '*'

print(ans)

Submission status: Accepted

Solution code:
_ = input()
s = input()
target = int(input()) - 1

result = []
for c in s:
  if c != s[target]:
    result.append('*')
  else:
    result.append(c)
    
print(''.join(result))

Submission status: Accepted

Solution code:
length = int(input())

words = input()
words = list(words)

target = int(input())

char = words[target-1]

for word in words:
    if word == char:
        print(word,end='')
    else:
        print('*',end='')

Submission status: Accepted

Solution code:
n=int(input())
tex=input()
k=int(input())

b=""

a=tex[k-1]

for i in range(n):
    if tex[i]!=a:
        b=b+"*"
    else:
        b=b+a
print(b)

Submission status: Accepted

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

correct = s[k-1]
ans =""
for i in s:
    if i != correct:
        ans += "*"
    else:
        ans+= i

print(ans)

Submission status: Accepted

Solution code:
n=int(input())
s=input()
l=int(input())
x=s[l-1]
for i in range(n):
    if s[i]!=x:
        s=s.replace(s[i],"*")
print(s)

Submission status: Accepted

Solution 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))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#coding:utf-8
n = int(input())
S = input()
k = int(input())
char = S[k-1]
S = [s if s == char else '*' for s in S]
print ("".join(S))

Submission status: Accepted

Solution code:
N = int(input())
S = str(input())
K = int(input())
x = S[K-1]
for i in S:
    if i == x:
        print(i, end='')
    else:
        print('*', end='')
print('')

Submission status: Accepted

Solution code:
import sys

N = int(sys.stdin.readline())
S = input()
K = int(sys.stdin.readline())

#print(N,K)
#print(type(S))

sk = S[K-1]
out = ""
for s in S:
    if sk==s:
        out += s
#        print("onaji",s)
    else:
        out += "*"
#        print("tigau",s)
print(out)

Submission status: Accepted

Solution code:
N=int(input())
S=input()
K=int(input())
t=S[K-1]
for i in range(N):
    if S[i]!=t:
        S=S[:i]+'*'+S[i+1:]
print(S)

Submission status: Accepted

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

Submission status: Accepted

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

_char = S[K-1]
_char_indexes = [i for i in range(N) if S[i]==_char]
answer=list("*"*N)
for i in _char_indexes:
    answer[i]=_char
print("".join(answer))

Submission status: Accepted

Solution code:
import string

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

remain = s[k-1]

for char in string.ascii_lowercase:
	if char == remain:
		continue
	else:
		s = s.replace(char, '*')
		
print(s)

Submission status: Accepted

Solution code:
N=input()
S=input()
reserve = S[int(input())-1]

for i in S:
    if i == reserve:
        print(reserve,end='')
    else:
        print('*', end='')
print()