My issue
I am getting correct output for custom input but it isn’t running the test cases
My code
import java.util.*;
import java.lang.*;
import java.io.*;
class Codechef
{
public static void main (String[] args) throws java.lang.Exception
{
// your code goes here
Scanner sc = new Scanner(System.in);
int tc = sc.nextInt();
while(tc-->0){
int n = sc.nextInt();
if((n&1)!=0){
for(int i=0;i<n;i++){
if((i&1)==0)
System.out.print("0");
else
System.out.print("1");
}
}
else{
while(n>4){
System.out.print("1001");
n-=4;
}
if(n==4)
System.out.print("1001");
else
System.out.print("01");
}
System.out.println();
}
}
}
Problem Link: Zero Ones Equal One Zeros Practice Coding Problem