#266. 字符串中间插入

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

字符串中间插入

String Insertion

Background

Congcong is learning string manipulation. He wants to try embedding a word into the middle of another string.

Problem Description

Given an "out" string of length 4, such as "<<>>", and a word, return a new string where the word is in the middle of the out string, e.g., "<<word>>". Note: use str.substring(i, j) to extract the String starting at index ii and going up to but not including index jj.

Input Format

Input is given from Standard Input in the following format.

out_str word

The first line contains two strings, out_str (the 4-character "out" string) and word (the word to insert), separated by a space.

Output Format

Output is to Standard Output in the following format.

The new string with word inserted into the middle of out_str.

Sample

<<>>" "Yay
"<<Yay>>"
<<>>" "WooHoo
"<<WooHoo>>"
[[]]" "word
"[[word]]"

Sample Explanation

For the first sample, the out string is "<<>>" and the word is "Yay". Inserting "Yay" into the middle of "<<>>" results in "<<Yay>>".

Constraints

Time limit: 1 second, Memory limit: 1024KB.