For this Question: You are given an integer array of size N such that 0 <= A[i] <= 9. You need to form two numbers by concatenating these digits. All digits of given array must be used to form the two numbers. Find the minimum possible sum of two numbers that you found.

Note: Your number can contain leading zeroes but the sum cannot.First line contains an integer N - the size of array 
Next line contains N space separated integers denoting elements of array.

Constraints
1 <= N <= 10^5
0 <= Ai<= 9Print the minimum sum that you obtain.Sample Input 1:
6
6 8 4 5 2 3

Output 
604

Explanation:
The minimum sum is formed by numbers 358 and 246
 
Sample Input 2:
5
5 3 0 7 4

Output 
82

Explanation
The minimum sum is formed by numbers 35 and 047., I have written this Solution Code: import java.io.*;
import java.util.*;

class Main {
    static String findSum(String str1, String str2)
{
    // Before proceeding further, make sure length
    // of str2 is larger.
    if (str1.length() > str2.length()){
        String t = str1;
        str1 = str2;
        str2 = t;
    }
 
    // Take an empty String for storing result
    String str = "";
 
    // Calculate length of both String
    int n1 = str1.length(), n2 = str2.length();
 
    // Reverse both of Strings
    str1=new StringBuilder(str1).reverse().toString();
    str2=new StringBuilder(str2).reverse().toString();
 
    int carry = 0;
    for (int i = 0; i < n1; i++)
    {
        // Do school mathematics, compute sum of
        // current digits and carry
        int sum = ((int)(str1.charAt(i) - '0') +
                    (int)(str2.charAt(i) - '0') + carry);
        str += (char)(sum % 10 + '0');
 
        // Calculate carry for next step
        carry = sum / 10;
    }
 
    // Add remaining digits of larger number
    for (int i = n1; i < n2; i++)
    {
        int sum = ((int)(str2.charAt(i) - '0') + carry);
        str += (char)(sum % 10 + '0');
        carry = sum / 10;
    }
 
    // Add remaining carry
    if (carry > 0)
        str += (char)(carry + '0');
 
    // reverse resultant String
    str = new StringBuilder(str).reverse().toString();
 
    return str;
}
	public static void main (String[] args)throws IOException {
// 		long mod = 1000000007;
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n;
		n = Integer.parseInt(br.readLine());
		int az[] = new int[n];
		    String line = br.readLine();
		    String[] strs = line.trim().split("\\s+");
		    for (int i = 0; i < n; i++) {
		         az[i] = Integer.parseInt(strs[i]);
		    }
		//     long sum=0,ans=0;
		PriorityQueue<Character> q = new PriorityQueue<Character>();
		for (int i = 0; i < n; i++) {
			q.add((char)('0'+az[i]));
		}
		String a="",b="";
		int s = 0;
		while (q.size()>0) {
			char c = q.peek();
			q.poll();
			if (s == 0) {
				a+=c;
			}
			else {
				b+=c;
			}
			s ^= 1;
		}
		String ans=findSum(a,b);
		boolean g=false;
		for(int i=0;i<ans.length();i++){
		    char c=ans.charAt(i);
		    if(g){
		        System.out.print(c);
		    }
		    else{
		        if(c=='0'){
		            
		        }
		        else{
		            g=true;
		            System.out.print(c);
		        }
		    }
		}
		

		//  while (sum>=k) {
		//      int x = q.peek();
		//      q.poll();
		//      if (x == 1) {
		//          sum--;
		//          ans++;
		//          continue;
		//      }
		//      sum -= (x / 2);
		//      q.add((x + 1) / 2);
		//      ans++;
		// }
		// long ans = a[0] * Math.max(a[1], a[2]);
		// 	



	}

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