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:
n = int(input())
s = list(str(input()))
k = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

key = S[K - 1]
ans = []

for char in S:
    if char != key:
        ans.append("*")
    else:
        ans.append(char)

print(*ans, sep="")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
S = [str(x) for x in input()]
K = int(input())
for a in range(N):
    if not S[a] == S[K - 1]:
        S[a] = '*'
print(''.join(S))

Submission status: Accepted

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

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

print("")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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.append(s[k])
    else:
        ans.append("*")
print(*ans,sep = "")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys


def solve(N: int, S: str, K: int):
    S = list(S)
    t = S[K-1]
    for i in range(len(S)):
        if(S[i] != t):
            S[i] = '*'
        
    print(''.join(S))

    return


# Generated by 1.1.5 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    S = next(tokens)  # type: str
    K = int(next(tokens))  # type: int
    solve(N, S, K)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
Length = int(input())
inputString = input()
SpecialIndex = int(input())
SpecialChar = inputString[SpecialIndex-1]
answer = ""
for i in inputString:
  if i != SpecialChar:
    answer += "*"
  else:
    answer += i
print(answer)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
size = int(input())
word = input()
index = int(input())
new_word = [i if i == word[index-1] else '*' for i in word]
print("".join(new_word))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
input();s=input();k=int(input())-1
for x in s:print(x if x==s[k]else'*',end='')

Submission status: Accepted

Solution code:
input();s=input();k=s[int(input())-1]
for x in s:print(k if k==x else'*',end='')

Submission status: Accepted

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

Submission status: Accepted

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

c = str[k-1]
str2 = ""
for char in str:
  if char == c:
    str2 += c
  else:
    str2 += "*"
    
print(str2)

Submission status: Accepted

Solution code:
def slove():
    import sys
    input = sys.stdin.readline
    n = int(input().rstrip('\n'))
    s = str(input().rstrip('\n'))
    k = int(input().rstrip('\n'))
    ls = []
    for i in range(n):
        if s[i] != s[k-1]:
            ls.append("*")
        else:
            ls.append(s[i])
    print("".join(ls))


if __name__ == '__main__':
    slove()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
input()
s=input()
k=int(input())
print(*[x if x==s[k-1] else '*' for x in s],sep='')

Submission status: Accepted

Solution code:
n=int(input())
s=input()
k=int(input())
print(''.join([x if x==s[k-1] else '*' for x in 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())

T = S[K-1]
res = [s if s==T else "*" for s in S]
print("".join(res))

Submission status: Accepted

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

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

print("".join(ans))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def slove():
    import sys
    input = sys.stdin.readline
    n = int(input().rstrip('\n'))
    s = list(str(input().rstrip('\n')))
    k = int(input().rstrip('\n'))
    ts = s[k-1]
    for i in range(n):
        if s[i] != ts:
            s[i] = "*"
    print("".join(s))


if __name__ == '__main__':
    slove()

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print("".join(s))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
input()
s=input()
n=int(input())
for i,c in enumerate(s):
    print(c if s[i]==s[n-1] else '*',end='')

Submission status: Accepted

Solution code:
n= int(input())
s=input()
k=int(input())
aa=-1
ans=[]
for i in s:
  if i ==s[k-1]:
    ans.append(i)
  else :
    ans.append('*')
anss=''.join(ans) 
print(''.join(ans) )

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin
mod = 10**9 + 7

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
sa = lambda h: [list(map(int, stdin.readline().split())) for i in range(h)]

n = ni()
s = ns()
k = ni()


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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print("".join(S_list))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#2019/09/27
N, L, K = [input() for i in range(3)]
L_replace = [("*" if (i != L[int(K)-1]) else  i) for i in L]
print("".join(L_replace))

Submission status: Accepted

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

for index,value in enumerate(S,start=1):

    if value != S[K-1] :

        S = S.replace(value,'*')

    elif value == '*' or value == S[K-1]:

        continue


print(S)

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 = input()
k = int(input())
for s in S:print(s if s == S[k-1] else "*",end = "")

Submission status: Accepted

Solution code:
n,s,k=int(input()),input(),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:
N,S,K=int(input()),input(),int(input())
s=S[K-1]

for i in list("abcdefghijklmnopqrstuvwxyz"):
  if i!=s:
    S=S.replace(i,"*")
print(S)

Submission status: Accepted

Solution code:
# tenka1-2019-beginnerB - *e**** ********e* *e****e* ****e**
def main():
    N, S, K = open(0).read().split()
    tgt = S[int(K) - 1]
    ans = [i if i == tgt else "*" for i in S]
    print("".join(ans))


if __name__ == "__main__":
    main()

Submission status: Accepted

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

mark=s[k-1]

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

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

S = []
for i in s:
    S.append(i)

ta = S[k-1]
    
for i in range(n):
    if S[i] == ta:
        print(S[i],end = "")

    else:
        print("*",end = "")

Submission status: Accepted

Solution code:
# coding: utf-8

N, S, K = int(input()), input(), int(input())
char = S[K - 1]
A = ''
for i in range(len(S)):
    if S[i] == char:
        A += S[i]
    else:
        A += '*'
print(A)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

e=s[k-1]

ans=''
for i in range(n):
    if s[i]==e:
        ans+=e
    else:
        ans+='*'
print(ans)

Submission status: Accepted

Solution code:
# 2019/09/12

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

K=s[k-1]
for i in range(n):
    if s[i]==K:continue
    s[i]='*'
print(*s,sep='')

Submission status: Accepted

Solution code:
N = int(input())
S = input()
K = int(input())
c0 = S[K-1]
L = []
for i in range(N):
  c = S[i] if S[i] == c0 else "*"
  L.append(c)
print("".join(L))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

S = [c for c in S_temp]

target = S[K-1]
for i in range(N):
  if S[i] != target:
    S[i] = '*'
print(*S, sep='')

Submission status: Accepted

Solution code:
n = int(input())
s = input()
k = int(input())
for i in set(s):
    if i == s[k-1]:
        continue
    else:
        s = s.replace(i, '*')
print(s)

Submission status: Accepted

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

sk = s[k-1]

new_s = ""
for cal in s:
  if cal != sk:
    new_s += "*"
  else:
    new_s += sk
print(new_s)

Submission status: Accepted

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

a=''

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

print(a)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
S = input()
k = int(input())
t = S[k-1]
for s in S:
    if s != t:
        print("*", end="")
    else:
        print(s, end="")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def main():

    N = int(input())
    S = input()
    K = int(input())
    ref = S[K-1]
    t = ""
    for c in S:
        if c == ref:
            t += ref
        else:
            t += "*"
    return t

if __name__ == '__main__':
    print(main())

Submission status: Accepted

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

Submission status: Accepted

Solution code:
input()
S = input()
k = int(input())

for s in S:
  print(s if s == S[k-1] else '*', end = '')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import re
n = int(input())
s = input()
k = int(input())
x = s[k-1]
print(re.sub('[^' + x + ']', '*', s))

Submission status: Accepted

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

Submission status: Accepted

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

l_s = list(s)
for i in range(n):
    if not l_s[i] == l_s[k-1]:
        l_s[i] = '*'
print(''.join(l_s))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

kc = S[K - 1]
ans = ''
for c in S:
  if c != kc:
    ans += '*'
  else:
    ans += c

print(ans)

Submission status: Accepted

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

ans_list = []
t = s[k-1]
for i in s:
  if i == t:
    ans_list.append(t)
  else:
    ans_list.append("*")
print("".join(ans_list))

Submission status: Accepted

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

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

Submission status: Accepted

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

t = S[K-1]
for i in range(len(S)):
    print(S[i] if S[i]==t else '*', end='')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# n, l = list(map(int, input().split()))
n = int(input())
s = list(input())
k = int(input())
moji = s[k-1]

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

Submission status: Accepted

Solution code:
input()
B = input()
k = int(input())
for v in B:
    print(v if B[k-1] == v else "*",end="")

Submission status: Accepted

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

c = s[k-1]

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

print(s)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
S = input()
K = int(input())
for s in S:
  if s == "*":
    continue
  if S[K-1] != s:
    S = S.replace(s, "*")
print(S)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
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:
import sys
sys.setrecursionlimit(10000000)
def input():
    return sys.stdin.readline()[:-1]
from bisect import *
from collections import *
from heapq import *
from fractions import Fraction

n = int(input())
S = input()
x = S[int(input())-1]
ans = ''
for c in S:
    if c != x:
        ans += '*'
    else:
        ans += x
print(ans)

Submission status: Accepted

Solution code:
#!usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

#A
def A():
    a,b,c = LI()
    if min(a,b) < c < max(a,b):
        print("Yes")
    else:
        print("No")
    return

#B
def B():
    n = I()
    s = S()
    k = I()
    f = s[k-1]
    for i in range(n):
        if s[i] != f:
            print("*",end = "")
        else:
            print(s[i],end = "")
    print()
    return

#C
def C():

    return

#D
def D():

    return

#E
def E():

    return

#F
def F():

    return

#G
def G():

    return

#Solve
if __name__ == "__main__":
    B()

Submission status: Accepted

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

ch = S[K-1]

x = [ch if ch == s else "*" for s in S]
print("".join(x))

Submission status: Accepted

Solution code:
input()
s = list(input())
print("".join(("*" if x != y else x for x in s[int(input())-1] for y in s )))

Submission status: Accepted

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

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 = 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()
r = int(input())
a = s[r-1]
ans = ''
for i in range(n):
  if s[i] == a:
    ans += s[i]
  else:
    ans += "*"
print(ans)

Submission status: Accepted

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

target = S[K - 1]
ans = ""
for s in S:
    if s != target:
        ans += "*"
    else:
        ans += target
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

O = []
for s in S:
    if s != S[K-1]:
        O.append("*")
    else:
        O.append(s)

print("".join(O))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import re

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

pat = re.compile(r'[^{0}]'.format(S[K-1]))

print(re.sub(pat,'*',S))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def solve(n, s, k):
    return "".join([("*" if s[i] != s[k-1] else s[i]) for i in range(n)])

n = int(input())
s = input()
k = int(input())
print(solve(n, s, k))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import re

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

r = S[K-1]
pattern = "[^%s]" % r
print(re.sub(pattern, '*', S))

Submission status: Accepted

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

x = s[k-1]
temp_list = []

for c in s:
  if c is not x:
    temp_list.append('*')
  else:
    temp_list.append(c)

print(''.join(temp_list))

Submission status: Accepted

Solution code:
from functools import reduce

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

print(reduce(lambda x, y: x + (y if y == S[K] else '*'), S, ''))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 998244353
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)
def pe(s): return print(str(s), file=sys.stderr)
def JA(a, sep): return sep.join(map(str, a))
def JAA(a, s, t): return s.join(t.join(map(str, b)) for b in a)


def main():
    n = I()
    s = S()
    k = I()

    return re.sub(r'[^{}]'.format(s[k-1]), '*', s)


print(main())

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = [a  if a == s[k-1] else "*" for a in s]
print("".join(ans))

Submission status: Accepted

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

answer = ['*'] * N
for i in range(N):
  if S[i] == c:
    answer[i] = c

print(''.join(answer))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


# 初項s, 交差dのn個の数列の和
def sum_of_arithmetic_progression(s, d, n):
    return n * (2 * s + (n - 1) * d) // 2


# aとbの最大公約数
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


# aとbの最小公倍数
def lcm(a, b):
    g = gcd(a, b)
    return a / g * b


def main():
    N = int(input())
    S = input()
    K = int(input())

    t = S[K - 1]
    ans = ""
    for c in S:
        if c != t:
            ans += "*"
        else:
            ans += c
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
# PROXY

N = int(input())
S = input().strip()
K = int(input())
newS = []
for elements in S:
    if S[K-1] != elements:
        elements = "*"
        newS.append(elements)
    else:
        newS.append(elements)
print("".join(newS))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

def main():
    N = int(input())
    S = input()
    K = int(input())

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


if __name__ == "__main__":
    main()

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())
Ss = input()
K = int(input())

anss = []
for S in Ss:
    anss += ['*' if S != Ss[K-1] else S]

print(''.join(anss))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import re
N = int(input())
S = input()
K = int(input())
print(re.sub('[^{' + S[K - 1] + ']', '*', S))

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:
        S[i] = "*"
print("".join(S))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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