For this Question: Given two strings S and T of the same length, you can rearrange the characters in S and T. Your task is to find if it is possible to rearrange S and T such that S is lexicographically smaller than T.The first line of input contains the string S. The next line of input contains the string T.

Constraints:-
1 <= |S| = |T| <= 100000

Note:- Both the string will contain only lowercase english letters.Print "YES" if it is possible to rearrange S and T such that S is lexicographically smaller than T else print "NO".Sample Input:-
school
newton

Sample Output:-
YES

Explanation:-
One of the possible rearrangements:- cshool < newton

Sample Input:-
efgh
abcd

Sample Output:-
NO, I have written this Solution Code: import java.io.*;
import java.util.*;



class Main {
	public static void main (String[] args) {

					  Scanner sc= new Scanner(System.in);
					  String str = sc.next();
					  String s= sc.next();

					  char min= str.charAt(0);

					  for(int i=0;i<str.length();i++){
                            if(str.charAt(i)<min){
								min= str.charAt(i);
							}
					  }

					  char max= s.charAt(0);

					  for(int i=0;i<s.length();i++){
						  if(s.charAt(i)>max){
							  max= s.charAt(i);
						  }
					  }

					  if(min<max){
						  System.out.print("YES");
					  }
					  else{
						  System.out.print("NO");
					  }




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