-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDNA Storage
More file actions
36 lines (32 loc) · 1001 Bytes
/
DNA Storage
File metadata and controls
36 lines (32 loc) · 1001 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
DNA Storage
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int t = scanner.nextInt();
while (t-- > 0) {
int n = scanner.nextInt();
String s = scanner.next();
String ans=" ";
for(int i=0;i<s.length();i=i+2)
{
if(s.charAt(i)=='0' && s.charAt(i+1)=='0')
{
ans+='A';
}
else if(s.charAt(i)=='0' && s.charAt(i+1)=='1')
{
ans+='T';
}
else if(s.charAt(i)=='1' && s.charAt(i+1)=='0')
{
ans+='C';
}
else if(s.charAt(i)=='1' && s.charAt(i+1)=='1'){
ans+='G';
}
}
System.out.println(ans);
}
}
}