You are given a String code, a position array and a length array. code contains an encoded string which you must decode using the following method. Step through the elements of position in order, and for each element i, take the substring of length length[i] at position position[i]. Insert the reverse of that substring before position position[i]+length[i], thereby creating a palindromic substring. All positions are 0-based. Return the decoded String.
Constraints - code will contain between 1 and 10 characters, inclusive. - code will contain only digits ('0'-'9') and letters ('a'-'z', 'A'-'Z'). - position will contain between 0 and 10 elements, inclusive. - length will contain the same number of elements as position. - position and length will always refer to a valid substring in the (partially decoded) string code. - Each element of length will be positive. - The return value will have at most 1000 characters.
Input Format: Line1 - No of test cases T (<50)
Next 3T LInes contain String code, Positions array and Length array for T test cases.