My issue
i was given correct output but indicate wrong please respond
My code
#include<stdio.h>
#include<string.h>
int main()
{
char sl[1000],cl;
int k;
scanf("%s %c %d",sl,&cl,&k);
int count=0;
for(int i=0;i<strlen(sl);i++)
{
if (sl[i]==cl)
{
count++;
if(count==k)
{
printf("%d\n",i);
return 0;
}
}
}
printf("-l\n");
return 0;
}
Learning course: Data Structures & Algorithms using C
Problem Link: https://www.codechef.com/learn/course/city-dsa-c/CITYDSC04/problems/SESO06