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 = input()
k = int(input())
string = s[k-1]
res = ""
for i in range(n):
    if s[i] != string:
        res += "*"
    else:
        res += string
print(res)

Submission status: Accepted

Solution code:
input()
S = input()
K = int(input())
for i in S:
  print(i if i == S[K-1] else "*",end="")
#5
#error
#2

Submission status: Accepted

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

a = s[k-1]

for i in range(n):
    if s[i]==a:
        continue
    else:
        s[i] = "*"

print("".join(s))

Submission status: Accepted

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

c = s[k-1]
ans = ""
for e in s:
    if e == c:
        ans += e
    else:
        ans += "*"

print(ans)

Submission status: Accepted

Solution code:

def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

n = ii()
s = list(input())
k = ii()
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=list(input())
K=int(input())
k=S[K-1]
for i in range(N):
    if S[i]!=k:
        S[i]="*"
print(*S,sep="")

Submission status: Accepted

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

Submission status: Accepted

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

char = s[k-1]

ret_list = []

for i in range(len(s)):
    if s[i] == char:
        ret_list.append(s[i])
    else:
        ret_list.append('*')

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

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    s = list(input())
    K = int(input())
    
    base = s[K-1]
    for i in range(N):
        if s[i] != base:
            s[i] = "*"
            
    print(*s,sep="")
    
if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
def main(n: int, s: str, k: int):
    rp = s[k - 1]

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


if __name__ == "__main__":
    n = int(input())
    s = input()
    k = int(input())

    main(n, s, k)

Submission status: Accepted

Solution code:
from re import sub

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

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

Submission status: Accepted

Solution code:
n = int(input())
s = list(input())
a = int(input())
b = s[a-1]
A = []
for i in s:
    if i != b:
        A.append("*")
    else:
        A.append(i)
print("".join(A))

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 = 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 = list(input())
k = int(input())

a = s[k-1]

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

n = int(input())
s = input().rstrip("\r\n")
k = int(input())
ans = ''
for c in s:
    if c != s[k-1]:
        ans += '*'
        continue
    ans += c
print(ans)

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:
import sys

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LMI(): return list(map(int, sys.stdin.readline().split()))
MOD = 10 ** 9 + 7
INF = float('inf')

N = I()
S = input()
K = I()

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

Submission status: Accepted

Solution code:
def main():
    length = int(input())
    string = list(input())
    index = int(input())
    not_replace = string[index - 1]
    for i in range(length):
        if string[i] != not_replace:
            string[i] = "*"
    print("".join(string))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n=int(input())
s=list(input())
k=int(input())
tmp = s[k-1]
res = ["0"]*n
for i in range(n):
    if s[i] != tmp:
        res[i] = "*"
    else:
        res[i] = tmp
print(*res, sep="")

Submission status: Accepted

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

ch = S[K-1]

r = ''
for si in S:
    if si == ch:
        r += si
    else:
        r += '*'

print(r)

Submission status: Accepted

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

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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 = str(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=list(input())
S=s[int(input())-1]
for i in range(n):
    if s[i]!=S:
        s[i]="*"
print("".join(s))

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:
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())
l = []
for i in s:
  if i == s[k - 1]:
    l.append(s[k - 1])
  else:
    l.append("*")
print(*l, sep="")

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 = input()
k = int(input())
for i in s:
    if i != s[k - 1]:
        s = s.replace(i, '*')
print(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+='*'
    else:
        a+=s[i]
print(a)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
s = input()
p = int(input())
sl = list(s)
c = sl[p-1]
sp = map(lambda x:"*" if x != c else x, sl)
print("".join(sp))

Submission status: Accepted

Solution code:
import sys
import os


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = int(sys.stdin.readline().rstrip())
    S = str(sys.stdin.readline().rstrip())
    K = int(sys.stdin.readline().rstrip())
    target = S[K-1]

    for i in range(N):
        if S[i] != target:
            print("*", end="")
        else:
            print(target, end="")


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:


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

K_char = S[K-1]
ans = ''
for i in S:
    if i == K_char:
        ans += i
    elif  i != K_char:
        ans += '*'
        
print(ans)

Submission status: Accepted

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

#----------
N = int(input().strip())
S = input().strip()
K = int(input().strip())
#----------
new_S=""
for word in S:
    if word != S[K-1]:
        new_S += "*"
    else:
        new_S += word

print(new_S)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import random as rng
import itertools as it
import collections as col
import heapq as hq
import sys
import copy as cp
sys.setrecursionlimit(10**9)


def dump_impl(*objects):
    print(*objects, file=sys.stderr)


def dump_dummy(*objects):
    pass


dump = dump_impl if "DEBUG" in sys.argv else dump_dummy

N = int(input())
S = input()
K = int(input())
ans = []
SK = S[K-1]
for si in S:
    ans.append(si if si == SK else '*')
print(''.join(ans))

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:
N=int(input())
S=list(input())
K=int(input())
for i in range(N):
  if S[i]!=S[K-1]:
    S[i]="*"
  
print(*S,sep="")

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

moji = s[k - 1]

ans = ''

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

print(ans)

Submission status: Accepted

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

target = s[k-1]

for i in range(len(s)):
  if target != s[i]:
    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:
        S[i] = '*'
print(*S,sep='')

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

for i in range(N):
  if not s[i] == s[index - 1]:
    s = s[0:i] + '*' + s[i + 1:]
print(s)

Submission status: Accepted

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

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

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()
K = int(input())
t = ''
for s in S:
  if s != S[K - 1]:
    t += '*'
  else:
    t += s
print(t)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
n = int(input())
a = input()
k = int(input())
for i in range(n):
    if a[k-1] == a[i]: print(a[i],end="")
    else: print("*",end="")

Submission status: Accepted

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

Submission status: Accepted

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

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:
# -*- coding: utf-8 -*-

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
S = input()
K = int(input())
A = [""] * N

c = S[K-1]

for i in range(N):
  if S[i] == c:
    A[i] = c
  else:
    A[i] = "*"
    
print("".join(A))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())
s = [i for i in input()]
k = int(input())
g = s[k-1]

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

print("".join(s))

Submission status: Accepted

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

ans = [i if i==t else "*" for i in S]
print("".join(ans))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
 
import math
import itertools
import sys
import copy
 
# 入力
#A, B, C, D = map(int, input().split())
#L = list(map(int, input().split()))
#S = list(str(input()))
N = int(input())
S = str(input())
K = int(input())

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

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

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

print(''.join(k))

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

y = s[m-1]

for ss in s:
    print(ss if ss == y else '*',end='')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
n = int(stdin.readline().rstrip())
s = stdin.readline().rstrip()
k = int(stdin.readline().rstrip())

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

Submission status: Accepted

Solution code:
n=int(input())
s=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=list(input())
K=int(input())
t=s[K-1]
for i in range(N):
    if s[i]!=t:
        s[i]="*"
print("".join(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=list(input())
K=int(input())
w=S[K-1]
ans=""
for i in range(N):
    if S[i]==w:
        ans+=w
    else:
        ans+="*"
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n=int(input())
s=list(input())
k=int(input())
key=s[k-1]
for i, si in enumerate(s):
    if si != key:
        s[i]="*"
print(*s,sep="")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
import sys
##  input functions for me
def ria(sep = ''):
    if sep == '' :
        return list(map(int, input().split())) 
    else: return list(map(int, input().split(sep)))
def rsa(sep = ''):
    if sep == '' :
        return input().split() 
    else: return input().split(sep)
def ri(): return int(input())
def rd(): return float(input())
def rs(): return input()
##
def main():
    N = ri()
    S = rs()
    K = ri() - 1
    ans = []
    for i in range(N):
        if S[i] != S[K]:
            ans.append('*')
        else:
            ans.append(S[K])
    print(''.join(ans))


if __name__ == "__main__":
    main()

Submission status: Accepted

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

obj = s[k-1]

ans = ""

for i in range(n):
	if s[i] == obj:
		ans += obj
	else:
		ans += "*"

print(ans)

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()
x=s[int(input())-1]
for i in range(n):
  if s[i]!=x:
    print("*",end="")
  else:
    print(x,end="")

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(*s, sep="")

Submission status: Accepted

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

std=S[K-1]

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

print(*S, sep="")

Submission status: Accepted

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

target=S[K-1]

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

print(''.join(S))

Submission status: Accepted

Solution code:
import re
int(input())
s=input()
print(re.sub('[^{}]'.format(s[int(input())-1]),"*",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:
N = int(input())
S = input()
K = int(input())

K -= 1

ans = ['*'] * N

for i in range(0, N):
	if S[i] == S[K]:
		ans[i] = S[K]

T = ''.join(ans)

print(T)

Submission status: Accepted

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

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())
a=''

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

Submission status: Accepted

Solution code:
import re

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

ans = re.sub(r"[^{}]".format(S[K-1]), "*", S)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution 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(''.join(S))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

letter = word[k - 1]
replaced = ""

for w in word:
  if w == letter:
    replaced += letter
  else:
    replaced += "*"

print(replaced)

Submission status: Accepted

Solution code:
n=int(input())
s=list(input())
k=int(input())
for i in range(n):
    if s[k-1]!=s[i]:
        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 = 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())
ans=[0 for i in range(N)]
d=S[K-1]
for i in range(N):
    if S[i] == d:
        ans[i]=S[i]
    else:
        ans[i]='*'
print(''.join(ans))

Submission status: Accepted

Solution code:
#coding:utf-8

n = int(input())
s = input()
k = int(input())
ans = []

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

print(''.join(ans))

Submission status: Accepted

Solution code:
a = int(input())
b = list(input())
c = int(input())
z = b[c-1]
for i in range(a):
    if not b[i] == z:
        b[i] = "*"
print(*b, sep="")

Submission status: Accepted

Solution code:
a = int(input())
b = input()
c = int(input())
z = b[c-1]
for i in b:
    if not i == z:
        print("*", end="")
    else:
        print(i, end="")

Submission status: Accepted

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

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

print(''.join(S))

Submission status: Accepted

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

Submission status: Accepted

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

char = S[K-1]

O = []
for i in range(N):
  if S[i] != char:
    O.append('*')
  else:
    O.append(char)
print(''.join(O))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    n = int(readline())
    s = str(readline().rstrip().decode('utf-8'))
    k = int(readline())
    r = s[k-1]
    ans = []
    for i in range(n):
        if s[i] != r:
            ans.append("*")
        else:
            ans.append(r)
    print("".join(ans))


if __name__ == '__main__':
    solve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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:
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 = list(input())
K = int(input())
for n in range(N):
    if S[n] != S[K-1]:
        S[n] = '*'
print(*S,sep='')

Submission status: Accepted

Solution code:
# 2019-11-23 01:28:44(JST)
import sys

def main():
    n, s, k = sys.stdin.read().split()
    n, k = map(int, [n, k])

    c = s[k-1]
    letters = set(s) - set(c)
    for l in letters:
        s = s.replace(l, '*')
    
    print(s)
    

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# 2019-11-23 01:28:44(JST)
import sys
from string import ascii_lowercase as alphabet


def main():
    n, s, k = sys.stdin.read().split()
    n, k = map(int, [n, k])

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import re
n,s,k=open(0)
print(re.sub("[^" + s[int(k)-1] + "]", "*", s[:-1]))

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

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[:i] + '*' + S[i+1:]
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(*S, sep="")

Submission status: Accepted

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

s_i = S[K-1]
for i in range(len(S)):
    if(S[i]==s_i):
        s += s_i
    else:
        s += "*"
        
print(s)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ss = list(s)
chr = ss[k - 1]
for i in range(n):
    if ss[i] != chr:
        ss[i] = '*'
for i in range(n):
    print(ss[i], 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 += s[i]
    else:
        ans += '*'

print(ans)

Submission status: Accepted

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

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())
c = s[k-1]
for i in s:
    if i == c:
        print(i,end='')
    else:
        print('*',end='')

Submission status: Accepted

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

Submission status: Accepted

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

ns = ""
for s in S:
    if s != S[K-1]:
        ns += "*"
    else:
        ns += s

print(ns)