#291. 字符串按短边截取拼接
字符串按短边截取拼接
String Concatenation with Truncation
Background
Congcong is currently learning about string operations. He encountered an interesting problem that requires concatenating two strings with some special rules.
Problem Description
Given two strings, concatenate them and return the result. However, if the strings have different lengths, omit characters from the beginning of the longer string so it becomes the same length as the shorter string. For example, "Hello" and "Hi" yield "loHi". The strings may be of any length.
Input Format
Input is given from standard input in the following format.
Two strings and , separated by a space.
Output Format
Output is printed to standard output in the following format.
The resulting concatenated string.
Sample
Hello Hi
loHi
Hello java
ellojava
java Hello
javaello
Sample Explanation
For Sample 1, string "Hello" has length 5, and string "Hi" has length 2. The shorter length is 2. Therefore, "Hello" is truncated from the beginning by 3 characters to become "lo\