Getting 1341M in SPOJ?
<p>I am getting 1341 Memory used on this simple program on SPOJ. I want to reduce it to 2 to 3M. How can I improve the code. Where I am using more memory. I have given program bwlow:</p>

<pre><code> import java.util.*;
 import java.lang.*;
 import java.io.*;

 class Test
 {
  public static void main (String[] args) throws java.lang.Exception
    {
    Scanner sc=new Scanner(System.in);
    String str=new String();
    String str1[]=new String[10];
    int len;
    int t=sc.nextInt();
    for(int i=0;i&lt;t;i++)
    {
        str=sc.next();
        str1=str.split("");
        len=str.length()/2;
        for(int j=0;j&lt;len;j++)
        {
            if(j%2==0)
            {
                System.out.print(str1[j]);
            }
        }
    System.out.println();

    }
}
}
</code></pre>