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

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

Submission status: Accepted

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

Sk = S[K-1]

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

output = ""

for j in S:
    output = output + j

print(output)

Submission status: Accepted

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

Submission status: Accepted

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

print(''.join(map(lambda s: '*' if s != S[K-1] else s, S)))

Submission status: Accepted

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

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 list(s)]))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys


l = raw_input().split()
N = int(l[0])
l = raw_input().split()
S = l[0]
l = raw_input().split()
K = int(l[0])

c = S[K - 1]
ret = ''
for s in S:
    if s != c:
        ret += '*'
    else:
        ret += s
print(ret)

Submission status: Accepted

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

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

print(''.join(S))

Submission status: Accepted

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

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

Submission status: Accepted

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

huga=hoge[k-1]

for i in range(n):
  if(hoge[i]==huga):
    print(huga,end="")
  else:
    print("*",end="")
    
print("")

Submission status: Accepted

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

S_k = S[K-1]

ans = []

for i in range(len(S)):
  if S[i] != S_k:
    ans.append('*')
  else:
    ans.append(S[i])
print(''.join(ans))

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.pop(i)
        s.insert(i,"*")
s="".join(s)
print(s)

Submission status: Accepted

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

for i in range(N):
    print(s[i], end = '')

print()

Submission status: Accepted

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

nokoru=S[K-1]

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

print ans

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

target = s[k-1]

ans = ""

for ss in s:
	if(ss == target):
		ans += ss
	else:
		ans += "*"
print(ans)

Submission status: Accepted

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

sub = s[k-1]

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

print(''.join(s))

Submission status: Accepted

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

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

del_char = s[a-1]

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

print("".join(s))

Submission status: Accepted

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

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

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

print()

Submission status: Accepted

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

k_s = S[K-1]
ans = ''
for s in S:
    if s == k_s:
        ans += k_s
    else:
        ans+='*'
print(ans)

Submission status: Accepted

Solution code:
#coding:utf-8

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

target = S[K-1]

result = ''
for string in S:
    if string == target:
        result += string
    else:
        result += '*'

print(result)

Submission status: Accepted

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

Submission status: Accepted

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

ans = list()
for c in S:
    if c == S[K]:
        ans.append(c)
    else:
        ans.append('*')

print(''.join(ans))

Submission status: Accepted

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

#%%
#n, s, k = 5, "error", 2

#%%
mask = s[k-1]

#%%
ans = []
for i in range(n):
    if s[i] != mask:
        ans.append("*")
    else:
        ans.append(mask)
#%%
print("".join(ans))

#%%

Submission status: Accepted

Solution code:
N = int(input())
S = input()
K = int(input())
x = S[K-1]
SS = []
for i in range(N):
    if not S[i] == x:
        SS.append("*")
    else:
        SS.append(x)
for c in SS:
    print(c,end = "")
print()

Submission status: Accepted

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

Submission status: Accepted

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

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


def r(c):
    if c == S[K - 1]:
        return c
    else:
        return '*'


print(''.join(map(r, S)))

Submission status: Accepted

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

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

y = ''
for i in range(N):
    y += T[i]

print(y)

Submission status: Accepted

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

a= s[k-1]

res = ""
for idx,x in enumerate(s):
    if s[idx] != a:
        res += "*"
    else:
        res += x
print(res)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
import math
from bisect import bisect_left
from bisect import bisect_right
import collections
input = sys.stdin.readline

# bisect_left(lists, 3)
# bisect_right(lists, 3)

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

	S=S[:-1]
	
	tmp = S[K-1]

	ans = ""
	for i in S:
		if i == tmp:
			ans += i
		else:
			ans += "*"

	print(ans)

	
	
if __name__ == "__main__":
	main()

Submission status: Accepted

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

o = s[k-1]
ans = [i if i == o else '*' for i in s]
print(''.join(ans))

Submission status: Accepted

Solution code:
_ = int(input().strip())
S = input().strip()
K = int(input().strip())

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

Submission status: Accepted

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

without_change_str = s[k - 1]

result = ""
for char in s:
    result += char if char == without_change_str else "*"
print(result)

Submission status: Accepted

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

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

print("".join(s))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import re

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

key = S[K - 1]

print(re.sub("[^" + key + "]", "*", S))

Submission status: Accepted

Solution code:
from sys import stdin

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

    sk = S[K-1]
    for i, s in enumerate(S):
        if s != sk:
            S[i] = '*'
    print(''.join(S))

input = lambda: stdin.readline().rstrip()
main()

Submission status: Accepted

Solution code:
def main():
    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))


main()

Submission status: Accepted

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

list = []

for s in S:
    if s == S[K-1]:
        list.append(s)
    else:
        list.append('*')

print(''.join(list))

Submission status: Accepted

Solution code:
from sys import stdin
# import math
import numpy as np
# N = int(stdin.readline().rstrip().split()[0])
# A = [int(x) for x in stdin.readline().rstrip().split()]
# N, X = [int(x) for x in stdin.readline().rstrip().split()]
# S = stdin.readline().rstrip().split()[0]

N = int(stdin.readline().rstrip().split()[0])
S = stdin.readline().rstrip().split()[0]
K = int(stdin.readline().rstrip().split()[0])

K = K-1

S_k = S[K]
arr = ""
for s in S:
  if s==S_k:
    arr += s
  else:
    arr += "*"
print(arr)

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

Submission status: Accepted

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

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

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('*', end='')
    else:
        print(i, end='')
print("")

Submission status: Accepted

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

lst_s = list(s)
for i, si in enumerate(s):
    if si != s[k-1]:
        lst_s[i] = '*'

print(''.join(lst_s))

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] = "*"
    else:
        pass
ans = ""
for i in range(N):
    ans += S[i]
print(ans)

Submission status: Accepted

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

_c = s[k - 1]
_s = ""

for c in s:
    if c != _c:
        _s += "*"
    else:
        _s += c

print(_s)

Submission status: Accepted

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

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

Submission status: Accepted

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

s_k = S[K-1]

output = ""
for s in S:
    if s == s_k:
        output += s_k
    else:
        output += "*"

print(output)

Submission status: Accepted

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

c = S[K-1]

l = ""
for s in S:
    if s == c:
        l += c
    else:
        l += "*"

print(l)

Submission status: Accepted

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

tg=s[k-1]

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

print(''.join(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 += i
    else:
        ans += '*'
print(ans)

Submission status: Accepted

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

keyword = S[K - 1]

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

print(''.join(S))

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

Submission status: Accepted

Solution code:
a = int(input())
b = list(str(input()))
c = int(input())

moji = b[c - 1]

for i in range(a):
    if b[i] != moji:
        b[i] = '*'

b = ''.join(b)
print(b)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(s)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
from sys import stdin
import math
import itertools


def makeIntMatrix(lines):
    intMatrix = []
    for a in makeStringMatrix(lines):
        intMatrix.append([int(b) for b in a])
    return intMatrix
 
 
def makeStringMatrix(lines):
    stringMatrix = [line.split() for line in lines]
    return stringMatrix
 
 
def makeInt(line):
    return int(line.rstrip())
 
 
def makeMultiInteger(line):
    return [int(x) for x in line.rstrip().split()]


def solve(input_string):
    N = makeInt(input_string[0])
    S = input_string[1].rstrip()
    K = makeInt(input_string[2])
    r = S[K-1]
    rS = ""
    for t in S:
        #print(t)
        if t != r:
            rS += "*"
        else:
            rS += t
    return rS


def main():
    input_lines = stdin.readlines()
    answer = solve(input_lines)
    print(answer)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

for s in S:
  if s == S[K-1]:
    re += S[K-1]
  else:
    re += '*'

print(re)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

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

k = s[k-1]

print("".join([k if i==k else "*" for i in s]))

Submission status: Accepted

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

S = list(S)
x = S[K-1]
S_index = [i for i in range(N) if S[i] != x]

for j in S_index:
  S[j] = "*"
  
print("".join(S))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

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

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

print(ss)

Submission status: Accepted

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

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

Submission status: Accepted

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

c = S[K]

l = ""

for d in S:
    if d == c:
        l = l + d
    else:
        l = l + "*"

print(l)

Submission status: Accepted

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

Submission status: Accepted

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

c = s[k-1]

output = []
for i in range(n):
        if(s[i] == c):
                output.append(c)
        else:
                output.append("*")
print(''.join(output))

Submission status: Accepted

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

target = S[K-1]

ans = ''
for i in range(len(S)):
    if S[i] == target:
        ans += ''.join(S[i])
    else:
        ans += ''.join('*')

print(ans)

Submission status: Accepted

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

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

er = S[K-1]
Ss = [i if i == er else "*" for i in S]
a = ""
for i in Ss:
    a += i
print(a)

Submission status: Accepted

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

Submission status: Accepted

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

no_change = S[K-1]

for i in S:
    if i != no_change:
        print("*",end = "")
    else:
        print(i,end="")
print()

Submission status: Accepted

Solution code:
from collections import defaultdict
from string import ascii_uppercase
import sys, bisect, math
stdin = sys.stdin
read_int = lambda : list(map(int,stdin.readline().split()))
read_str = lambda : stdin.readline().rstrip()

N = read_int()[0]
S = read_str()
K = read_int()[0]

def solve():
    ans = ""
    sk = S[K - 1]
    for i in range(N):
        if S[i] != sk:
            ans += "*"
        else:
            ans += S[i]
    return ans

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

Submission status: Accepted

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

s_i = s[k-1]

s_ans = ''
for i in s:
  if i == s_i:
    s_ans += i
  else:
    s_ans += '*'

print(s_ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import re

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding:utf-8

def main():
    N = int(input())
    S = input()
    K = int(input())
    change = S[K-1]
    # print(change)
    str_list = list(S)
    ans = []
    for i in str_list:
        if i != change:
            ans.append("*")
        else:
            ans.append(i)
    str_changed = "".join(ans)
    print(str_changed)


if __name__ == "__main__":
    main()

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]="*"

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

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:
N=int(input())
S=input()
K=int(input())

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

Submission status: Accepted

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

tmp = S[K-1]
st = ""
for t in S:
    if t != tmp:
        st = st + "*"
    else:
        st = st + t

print(st)

Submission status: Accepted

Solution code:
from sys import stdin
N=int(stdin.readline().rstrip())
S=(stdin.readline().rstrip())
K=int(stdin.readline().rstrip())
s=S[K-1]

ans=""
for i in list(S):
    if i != s:
        ans+="*"
    else:
        ans+=i
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    n = int(input())
    s = input()
    k = int(input())

    ret = ''
    for c in s:
        if c == s[k-1]:
            ret += c
        else:
            ret += '*'

    print(ret)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
S = str(input())
K = int(input())
target_char = S[K-1]
ans = []
for i in range(N):
    if S[i] != target_char:
        ans.append("*")
    else:
        ans.append(target_char)
ans2 = ""
for i in range(N):
    ans2 += ans[i]
print(ans2)

Submission status: Accepted

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

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 = ans + "*"
    else:
        ans = ans + c
print(ans)

Submission status: Accepted

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

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

k = int(input())

temp = s[k-1]

# print(temp)

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

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

Submission status: Accepted

Solution code:
# coding: UTF-8
import sys
#sys.setrecursionlimit(n)
import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *

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

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

Submission status: Accepted

Solution code:
_, string, pos = [raw_input() for i in range(3)]
char = string[int(pos) - 1]
out = ""
for i in string:
    out += (i if i == char else "*")
print(out)

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

char = s[k-1]

return_ = []

for i in range(n):
    if s[i] != char:
        return_.append('*')
    else:
        return_.append(s[i])

print("".join(return_))

Submission status: Accepted

Solution code:
import sys
from collections import deque
import copy
import math
def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline



def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    [N] = [int(input_raw[0])]
    input_raw = read_func().strip().split()
    S = input_raw[0]
    input_raw = read_func().strip().split()
    [K] = [int(input_raw[0])]
    s = S[K - 1]
    new_S = ""
    for i in range(N):
        if S[i] != s:
            new_S += "*"
        else:
            new_S += S[i]
    print new_S


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
s = input()
k = int(input())
ans = ''
sk = s[k-1]
for i in range(n):
    if s[i] == sk:
        ans += sk
    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 += '*'
    else:
        result += S[i]
print(result)

Submission status: Accepted

Solution code:
"""
python3 a.py < input.txt
"""
import math
import itertools as it
import heapq

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

sk=S[K-1]
O=[]
for i in range(0,N):
    if S[i] == sk:
        O.append(S[i])
    else:
        O.append("*")

print("".join(O))

Submission status: Accepted

Solution code:
from heapq import heappush,heappop


def int_raw():
    return int(input())

def ss_raw():
    return input().split()

def ints_raw():
    return list(map(int, ss_raw()))


def runLength(in_str):
    kukan = 1
    start = 0
    ret = []
    for i in range(1,len(in_str)):
        if in_str[i-1]!=in_str[i]:
            ret.append([in_str[i-1],kukan,start])
            start = i
            kukan=0
        kukan+=1
    ret.append([in_str[-1],kukan,start])
    return ret

N = int_raw()
S= input()
K = int_raw()

def main():
    ans =""
    for c in S:
        if c==S[K-1]:
            ans+=c
        else:
            ans+="*"
    return ans


print(main())

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
AtCoder B
"""

def main():
    N=input()
    S=list(map(str,input().split()))[0]
    K=int(input())

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

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n = int(input())
S = input()
K = int(input())
temp = S[K-1]
for i in range(n):
    if S[i] != temp:
            S = S[:i]+"*"+S[min(i+1,n):]
print(S)

Submission status: Accepted

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

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

out = ''

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

print(out)

Submission status: Accepted

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


ch = S[K-1]

for i in range(N):
    if S[i] != ch and S[i] != '*':
        S =S.replace(S[i],'*')

print(S)

Submission status: Accepted

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

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

s = S[K - 1]

import re
ans = re.sub(r'[^{}]'.format(s), '*', S)
print(ans)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
###
#main
if __name__ == "__main__":
    N = int(input())
    S = input()
    K = int(input())
    target = S[K-1]
    result = ""
    for i in range(len(S)):
        if S[i] != target:
            result += "*"
        else:
            result += S[i]
    print(result)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline
INF = float('inf')
MOD = 10**9+7
dy = [0,1,0,-1]
dx = [1,0,-1,0]
ddy = [0,1,1,1,0,-1,-1,-1]
ddx = [1,1,0,-1,-1,-1,0,1]

n = int(input())
S = input()
k = int(input())
t = S[k-1]
res = ""
for s in S:
    if s == t:
        res += s
    else:
        res += '*'
print(res[:-1])

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=ans+'*'
    else:
        ans=ans+S[i]
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
S = input()
K = int(input())
A = S[K-1]
for s in S:
    if s != A:
        S = S.replace(s,'*')
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 = list(input())
K = int(input())
s = S[K - 1]
retval = ['*' if i != s else i for i in S]
print(''.join(retval))

Submission status: Accepted

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

Submission status: Accepted

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

x = S[K-1]
for i in range(len(S)):
    if S[i] != x:
        ans += "*"
    else:
        ans += S[i]

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

for i in range(n):
    print(t[i], end="")

Submission status: Accepted

Solution code:
import sys
import math
 
ni = lambda: int(ns())
na = lambda: list(map(int, input().split()))
ns = lambda: input()

N = ni()
S = ns()
K = ni()-1
R = ""
s = S[K]
for i in range(N):
    if(S[i]!=s):
        R += "*"
    else:
        R += S[i]
print(R)

Submission status: Accepted

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

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

c = s[k-1]
out = re.sub('[^{}]'.format(c), "*", s)

print(out)

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:
import re
n = int(input())
s = input()
k = int(input())
#print(s.replace(s[k-1], "*"))
print(re.sub('[^{}]'.format(s[k-1]), "*", s))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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