We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
public static void solucion(String a,String b){
ArrayList<String> lista = new ArrayList<String>();
int total = a.length() + b.length();
lista.add(a.replace(a.charAt(0), a.toUpperCase().charAt(0)));
lista.add(b.replace(b.charAt(0), b.toUpperCase().charAt(0)));
//Collections.sort(lista);
System.out.println(total);
if(lista.get(0).compareTo(lista.get(1)) <=0 ){
System.out.println("No");
}
else{
System.out.println("Yes");
}
System.out.println(lista.get(0)+" "+lista.get(1));
}
public static void main(String[] args) {
/* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */
Scanner scanner = new Scanner(System.in);
String a = scanner.nextLine();
String b = scanner.nextLine();
scanner.close();
solucion(a,b);
}
}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Java Strings Introduction
You are viewing a single comment's thread. Return to all comments →
JAVA SOLUTION
import java.io.; import java.util.;
public class Solution {
}