For this Question: Given a single integer N. You have to print a pattern of 2*N lines such that 

First line contains 1 "*", next line contains 2*1=2 "#", third line contains 3 "*", fourth line contains 2*3 = 6 "#", fifth line contains 5 "*", sixth line contains 2*5 = 10 "#" and so on. 

(See the example for more understanding of the pattern ).Only line will contain a single integer N.

<b>Constraints</b>
1 &le; N &le; 1000Output 2*N lines of required pattern.Input:
4

Output:
*
##
***
######
*****
###########
*******
###############

Explanation:
1st line => 1 "*"
2nd line => 2 "#"
3rd line => 3 "*"
4th line => 6 "#"
5th line => 5 "*"
6th line => 10 "#"
7th line => 7 "*"
8th line => 14 "#", I have written this Solution Code: import java.io.*;
import java.util.*;



public class Main {
     
    public static int maxDigit(Long x){
        int mx=0;
        while(x>0){
            long cur=x%10;
            x/=10;
            mx=Math.max(mx,(int)cur);
        }
        return mx;
    }
    public static void main(String[] args) {
        
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        
        int n=Integer.parseInt(in.next());
        for(int i=0;i<n;i++){
            int odd=2*i+1;
            for(int j=0;j<odd;j++){
               out.print("*");
            }
            out.println();
            int even=2*odd;
            for(int j=0;j<even;j++){
               out.print("#");
            }
            out.println();
        }
        out.close();
        
    }

    
    static class InputReader {
        BufferedReader reader;
        StringTokenizer tokenizer;
        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void print(Object... objects) {
            for (int i = 0; i < objects.length; i++) {
                if (i != 0) {
                    writer.print(' ');
                }
                writer.print(objects[i]);
            }
        }

        public void println(Object... objects) {
            print(objects);
            writer.println();
        }

        public void close() {
            writer.close();
        }

        public void println(int i) {
            writer.println(i);
        }

    }
}
, In this Programming Language: Java, Now tell me if this Code is compilable or not?