Problem Description
"A string is traditionally a sequence of characters, either as a literal constant or as some kind of variable." — Wikipedia: String (computer science)
This exercise is to test your understanding of Java Strings. A sample String declaration:
String myString = "Hello World!"
The elements of a String are called characters. The number of characters in a string is called the length, and it can be retrieved with the String.length() method.
Some important methods for Strings in Java:
Learn more about strings and its methods by clicking here.
Task:
Given two strings of lowercase English letters, A and B, perform the following operations:
Input Format
The first line contains string A. The second line contains another string B. The strings are comprised of only lowercase English letters.
Output Format
There are three lines of output:
For the first line, sum the lengths of A and B.
For the second line, write Yes if A is lexicographically greater than B otherwise print No instead.
For the third line, Capitalize the complete string A and B and print them on a single line, separated by a space.
Example Input
Input 1:
abc def
Example Output
Output 1:
6 No ABC DEF
Example Explanation
Explanation 1:
Length of A = 3 and B = 3 so len(A) + len(B) = 6 String "abc" is lexicographically smaller than "def"