My issuehttps://discuss.codechef.com/c/bug-reports/326
getting run time error what should i do
My code
#include <stdio.h>
#include <stdlib.h>
int main(void) {
char str[20];
int n, m;
scanf("%d", &n);
while (n > 0) {
scanf("%d", &m);
scanf("%s", str);
for (int i = 0; i < m; i++) {
if (str[i] == '0' && str[i + 1] == '0') {
printf("A");
} else if (str[i] == '0' && str[i + 1] == '1') {
printf("T");
} else if (str[i] == '1' && str[i + 1] == '0') {
printf("C");
} else if (str[i] == '1' && str[i + 1] == '1') {
printf("G");
}
i++;
}
printf("\n");
n--;
}
return 0;
}
Learning course: Strings using C
Problem Link: CodeChef: Practical coding for everyone