#291. 字符串按短边截取拼接

    ID: 291 Type: Default 1000ms 256MiB Tried: 0 Accepted: 0 Difficulty: (None) Uploaded By: Tags>codingbatString-1gesp3字符串

字符串按短边截取拼接

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 S1S_1 and S2S_2, 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\