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:
import sys
import heapq
import math
import fractions
import bisect
import itertools
from collections import Counter
from collections import deque
from operator import itemgetter
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

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 s:
  if i!=s[k-1]:
    ans+='*'
  else:
    ans+=i
print(ans)

Submission status: Accepted

Solution code:
import math
import collections
import fractions
import itertools

def solve():
    n = int(input())
    s = list(input())
    k= int(input())
    tar = s[k-1]
    for i in range(n):
        if tar != s[i]:
            s[i] = "*"
    print("".join(s))
    return 0

if __name__ == "__main__":
    solve()

Submission status: Accepted

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

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.append(a)
  else:
    ans.append('*')
print(''.join(ans))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
S = str(input())
K = int(input())
t = S[K-1]
ans = ""
for i in range(N):
  if S[i] == t:
    ans += S[i]
  else:
    ans += "*"
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+=x
  else:
    ans+='*'
print(ans)

Submission status: Accepted

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

import sys
from typing import Any, Callable, Deque, Dict, List, Mapping, Optional, Sequence, Set, Tuple, TypeVar, Union
# import time
# import math, cmath
# import numpy as np
# import scipy.sparse.csgraph as cs            # csgraph_from_dense(ndarray, null_value=inf), bellman_ford(G, return_predecessors=True), dijkstra, floyd_warshall
# import random                                # random, uniform, randint, randrange, shuffle, sample
# import string                                # ascii_lowercase, ascii_uppercase, ascii_letters, digits, hexdigits
# import re                                    # re.compile(pattern) => ptn obj; p.search(s), p.match(s), p.finditer(s) => match obj; p.sub(after, s)
# from bisect import bisect_left, bisect_right # bisect_left(a, x, lo=0, hi=len(a)) returns i such that all(val<x for val in a[lo:i]) and all(val>-=x for val in a[i:hi]).
# from collections import deque                # deque class. deque(L): dq.append(x), dq.appendleft(x), dq.pop(), dq.popleft(), dq.rotate()
# from collections import defaultdict          # subclass of dict. defaultdict(facroty)
# from collections import Counter              # subclass of dict. Counter(iter): c.elements(), c.most_common(n), c.subtract(iter)
# from datetime import date, datetime          # date.today(), date(year,month,day) => date obj; datetime.now(), datetime(year,month,day,hour,second,microsecond) => datetime obj; subtraction => timedelta obj
# from datetime.datetime import strptime       # strptime('2019/01/01 10:05:20', '%Y/%m/%d/ %H:%M:%S') returns datetime obj
# from datetime import timedelta               # td.days, td.seconds, td.microseconds, td.total_seconds(). abs function is also available.
# from copy import copy, deepcopy              # use deepcopy to copy multi-dimentional matrix without reference
# from functools import reduce                 # reduce(f, iter[, init])
# from functools import lru_cache              # @lrucache ...arguments of functions should be able to be keys of dict (e.g. list is not allowed)
# from heapq import heapify, heappush, heappop # built-in list. heapify(L) changes list in-place to min-heap in O(n), heappush(heapL, x) and heappop(heapL) in O(lgn).
# from heapq import _heapify_max, _heappop_max, _siftdown_max
# from heapq import nlargest, nsmallest        # nlargest(n, iter[, key]) returns k-largest-list in O(n+klgn).
# from itertools import count, cycle, repeat   # count(start[,step]), cycle(iter), repeat(elm[,n])
# from itertools import groupby                # [(k, list(g)) for k, g in groupby('000112')] returns [('0',['0','0','0']), ('1',['1','1']), ('2',['2'])]
# from itertools import starmap                # starmap(pow, [[2,5], [3,2]]) returns [32, 9]
# from itertools import product, permutations  # product(iter, repeat=n), permutations(iter[,r])
# from itertools import combinations, combinations_with_replacement
# from itertools import accumulate             # accumulate(iter[, f])
# from operator import itemgetter              # itemgetter(1), itemgetter('key')
# from fractions import Fraction               # Fraction(a, b) => a / b ∈ Q. note: Fraction(0.1) do not returns Fraciton(1, 10). Fraction('0.1') returns Fraction(1, 10)



def main():
    Num = Union[int, float]
    mod = 1000000007                # 10^9+7
    inf = float('inf')              # sys.float_info.max = 1.79e+308
    # inf = 2 ** 63 - 1             # (for fast JIT compile in PyPy) 9.22e+18
    sys.setrecursionlimit(10**6)    # 1000 -> 1000000
    def input(): return sys.stdin.readline().rstrip()
    def ii():    return int(input())
    def isp():   return input().split()
    def mi():    return map(int, input().split())
    def mi_0():  return map(lambda x: int(x)-1, input().split())
    def lmi():   return list(map(int, input().split()))
    def lmi_0(): return list(map(lambda x: int(x)-1, input().split()))
    def li():    return list(input())
    # def _heappush_max(h, item): h.append(item); _siftdown_max(h, 0, len(h)-1)
    
    
    n = ii()
    s = input()
    k = ii()
    char = s[k-1]
    buf = []
    for i in range(n):
        if s[i] == char:
            buf.append(s[i])
        else:
            buf.append('*')
    print(''.join(buf))


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n,s,k=open(0).read().split();k=int(k)-1;
print("".join([("*" if x!=s[k] else x) for x in s]))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

if __name__ == "__main__":
    solve()

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

Submission status: Accepted

Solution code:
N,S,K=open(0).read().split()
print("".join(["*" if i!=S[int(K)-1] else i for i in S ]))

Submission status: Accepted

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

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())
#文字列の取得
alt_str = S[K-1]
alt_txt = ""
for i in range(N):
    if S[i] != alt_str:
        alt_txt += '*'
    else:
        alt_txt += alt_str
print(alt_txt)

Submission status: Accepted

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

Submission status: Accepted

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

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

K = K - 1

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

Submission status: Accepted

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

c = S[K -1]
for i in S:
    if i != c:
        print('*', end='')
    else:
        print(i, 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:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees#, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10**9 + 7
#from decimal import *

B = INT()
S = input()
K = INT()

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

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

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

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:
if __name__ == '__main__':
    n = int(input())
    s=input()
    k=int(input())
    l=s[k-1]

    ans=""
    for i in s:
        if i == l:
            ans+=i
        else:
            ans+="*"
    print(ans)

Submission status: Accepted

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

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

for i in range(N):
    if A[i]!=A[x-1]:
        A=A.replace(A[i],"*")
        
print(A)

Submission status: Accepted

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

Submission status: Accepted

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

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math
#from math import gcd
import bisect
from collections import defaultdict
from collections import deque
from collections import Counter
from functools import lru_cache


#############
# Constants #
#############

MOD = 10**9+7
INF = float('inf')

#############
# Functions #
#############

######INPUT######
def I(): return int(input().strip())
def S(): return input().strip()
def IL(): return list(map(int,input().split()))
def SL(): return list(map(str,input().split()))
def ILs(n): return list(int(input()) for _ in range(n))
def SLs(n): return list(input().strip() for _ in range(n))
def ILL(n): return [list(map(int, input().split())) for _ in range(n)]
def SLL(n): return [list(map(str, input().split())) for _ in range(n)]

######OUTPUT######
def P(arg): print(arg); return
def Y(): print("Yes"); return
def N(): print("No"); return
def E(): exit()
def PE(arg): print(arg); exit()
def YE(): print("Yes"); exit()
def NE(): print("No"); exit()

#####Shorten#####
def DD(arg): return defaultdict(arg)


#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)

######Combination######
kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

######Factorization######
def factorization(n):
  arr = []
  temp = n
  for i in range(2, int(-(-n**0.5//1))+1):
    if temp%i==0:
      cnt=0
      while temp%i==0: 
        cnt+=1 
        temp //= i
      arr.append([i, cnt])
  if temp!=1:
    arr.append([temp, 1])
  if arr==[]:
    arr.append([n, 1])
  return arr

#####MakeDivisors######
def make_divisors(n):
  divisors = []
  for i in range(1, int(n**0.5)+1):
    if n % i == 0:
      divisors.append(i)
      if i != n // i: 
        divisors.append(n//i)
  return divisors

#####MakePrimes######
def make_primes(N):
  max = int(math.sqrt(N))
  seachList = [i for i in range(2,N+1)]
  primeNum = []
  while seachList[0] <= max:
    primeNum.append(seachList[0])
    tmp = seachList[0]
    seachList = [i for i in seachList if i % tmp != 0]
  primeNum.extend(seachList)
  return primeNum

#####GCD#####
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

#####LCM#####
def lcm(a, b):
    return a * b // gcd (a, b)

#####BitCount#####
def count_bit(n):
  count = 0
  while n:
    n &= n -1
    count += 1
  return count

#####ChangeBase#####
def base_10_to_n(X, n):
  if X//n:
    return base_10_to_n(X//n, n)+[X%n]
  return [X%n]

def base_n_to_10(X, n):
  return sum(int(str(X)[-i-1])*n**i for i in range(len(str(X))))

#####IntLog#####
def int_log(n, a):
  count = 0
  while n>=a:
    n //= a
    count += 1
  return count

#############
# Main Code #
#############
N = I()
S = S()
K = I()

l = S[K-1]

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
s = list(input())
k = int(input())
e = s[k-1]
ans = []
for i in s:
    if i != e:
        ans.append("*")
    else:
        ans.append(i)
print("".join(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] = "*"

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

Submission status: Accepted

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

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

Submission status: Accepted

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

print(ans)

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

Submission status: Accepted

Solution code:
from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations # (string,3) 3回
from collections import deque
from collections import defaultdict
import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
n = I()
s = list(input())
k = I() - 1
p = s[k]
for i in range(n):
    if p != s[i]:
        s[i] = '*'
print(*s,sep='')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
s = input()
k = int(input())
tmp = s[k - 1]
for i in range(n):
    if s[i] != tmp:
        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("".join(s))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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:
from sys import stdin
import math
import re
import queue

input = stdin.readline

MOD = 1000000007
INF = 122337203685477580

def solve():
    N = int(input().rstrip())
    S = (input().rstrip())
    str = list(S)
    K = int(input().rstrip())
    s = str[K-1]
    for i in range(N):
        if(str[i] != s):
            str[i] = "*"
    print(''.join(str))

if __name__ == '__main__':
    solve()

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

Submission status: Accepted

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

char = s[k-1]

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

Submission status: Accepted

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

a = S[K-1]
S_ = [i for i in S]
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()
m = int(input())
print(*['*' if x != s[m-1] else x for x in s], sep='')

Submission status: Accepted

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

Submission status: Accepted

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


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

print(''.join(S))

Submission status: Accepted

Solution code:
import sys
readline = sys.stdin.buffer.readline
def even(n): return 1 if n%2==0 else 0
n = int(readline())
s = readline().rstrip().decode('utf-8')
k = int(readline())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
s=input()
k=int(input())
for i in range(n):
    if s[i] == s[k-1]:
        print(s[i],end="")
    else:
        print("*",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 = int(input())
s = input()
k = int(input()) - 1
s_ = s[k]
print("".join([si if si == s_ else "*" for si in s]))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
s = input() #sys.stdin.readlineは最後が改行
k = int(input())

tt = s[k-1]

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

print(*ans,sep='')

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    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))
resolve()

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    n=int(input())
    s=list(input())
    k=int(input())
    l=['*']*n
    for i in range(n):
        if s[i]==s[k-1]:
            l[i]=s[k-1]
    print(''.join(l))
resolve()

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    n=int(input())
    s=input()
    k=int(input())
    l=[]
    for i in range(n):
        if s[i]==s[k-1]:
            l.append(s[k-1])
        else:
            l.append('*')
    print(''.join(l))
resolve()

Submission status: Accepted

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

c = s[k-1]

res = [ch if ch==c else '*' for ch in s]

print(''.join(res))

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

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()

def resolve():

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


resolve()

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

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())
T=""
s=S[K-1]
for i in S:
    if i!=s:
        T+="*"
    else:
        T+=s
print(T)

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 7)
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    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))


if __name__ == '__main__':
    resolve()

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n, s, k = open(0)
j = s[int(k)-1]
print("".join(["*",j][i==j] for i in s)[:-1])

Submission status: Accepted

Solution code:
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    #from operator import itemgetter

    #inf = 10**17
    #mod = 10**9 + 7

    n = int(input())
    s = list(input().rstrip())
    k = int(input())
    a = s[k-1]
    for i in range(n):
        if s[i] == a:
            continue
        s[i] = '*'
    print(*s, sep='')

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# 1
# https://atcoder.jp/contests/yahoo-procon2019-qual/tasks/yahoo_procon2019_qual_a
if False:
    N,K=map(int,input().split())
    print('YES' if N-K-(K-1)>=0 else 'NO')

# 2
# https://atcoder.jp/contests/exawizards2019/tasks/exawizards2019_b
if False:
    N=int(input())
    S=input()
    print('Yes' if S.count('R')>S.count('B') else 'No')

# 3
# https://atcoder.jp/contests/exawizards2019/tasks/exawizards2019_a
if False:
    print('Yes' if len(set(input().split()))==1 else 'No')

# 4
# https://atcoder.jp/contests/tenka1-2019-beginner/tasks/tenka1_2019_b
if True:
    N=int(input())
    S=input()
    K=int(input())
    r=S[K-1]
    ans=''
    for s in S:
        if s==r: ans+=s
        else: ans+='*'
    print(ans)

Submission status: Accepted

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

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

print("".join(S))

Submission status: Accepted

Solution code:
length= int(input())
moji = str(input())
num = int(input())
set = moji[num-1]
ans = ""
for i in range(length):
  if moji[i] != set:
    ans += "*"
  else:
    ans += moji[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:
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    n=int(input())
    s=input()
    k=int(input())
    ans=""
    sx=s[k-1]
    for ss in s:
        if ss!=sx:
            ans+='*'
        else:
            ans+=sx 
    print(ans)

if __name__=='__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = int(input())
b = input()

c = b[int(input()) - 1]

s = [b[i] if b[i] == c else '*' for i in range(a)]

print(''.join(s))

Submission status: Accepted

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

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

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