For this Question: Given an array <b>a</b> of n integers. Find the maximum value of <b>(i + j)</b> such that <b>1 &le; i < j &le; n and a[i] = a[j]</b>.The First line of the input contains n.
The next line contains n space-separated integers.

<b>Constraints</b>
1 &le; n &le; 10<sup>5</sup>
1 &le; a[i] &le; nOutput a single integer denoting maximum sum.Input:
6
2 3 1 2 3 5

Output:
7

Explanation:
for 2 => i = 1, j = 4 => i+j = 5
for 3 => i = 2, j = 5 => i+j = 7, I have written this Solution Code: import java.io.*;
import java.util.*;


public class Main {
     
   
    
    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());
        int a[] = new int[n];
        
        for(int i=0;i<n;i++){
            a[i] = Integer.parseInt(in.next());
        }
        
        int index[] = new int[n+1];
        Arrays.fill(index,0);
        int ans=0;
        for(int i=0;i<n;i++){
            if(index[a[i]]!=0){
               ans=Math.max(ans,index[a[i]] + i + 1);
            }
            index[a[i]]=i+1;
        }
        
        out.print(ans);
        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?