package yukicoder022; import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner sc=new Scanner(System.in); int n=sc.nextInt();//文字数 int k=sc.nextInt();//何文字目の対応を取るか(1<=k<=n) String s=sc.next(); int[] table=new int[n]; int count=0; for(int i=0;i=0;i--){ if(table[i]==table[k-1]){ System.out.println(i+1); return; } } } } }