My issue
what are the problem in my code
My code
/* package codechef; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Codechef
{
public static void main (String[] args) throws java.lang.Exception
{
// your code goes here
Scanner s = new Scanner(System.in);
int t = s.nextInt();
while(t-- > 0){
int n = s.nextInt();
String sc = s.next();
String result = "";
for(int i = 0;i < n;i+=2){
if(sc.charAt[i] == '0' && sc.charAt[i + 1] == '0'){
result +="A";
}
else if(sc.charAt[i] == '0' && sc.charAt[i + 1] == '1'){
result += "T";
}
else if(sc.charAt[i] == '1' && sc.charAt[i + 1] == '0'){
result += "C";
}
else{
result += "G";
}
}
System.out.println(result);
}
}
}
Learning course: Strings using Java
Problem Link: CodeChef: Practical coding for everyone