Rearrange Integer Matrix - Alphabets
Rearrange Integer Matrix - Alphabets PROBLEM STATEMENT : The program must accept an integer matrix M1 and a character matrix M2 having the same size R*C as the input. The matrix M2 contains only lower case alphabets. The program must rearrange the integer matrix M1 based on the positions of the alphabets in M2 after sorting the alphabets. The integer value in M1 must be relocated to the original position (before sorting) of the alphabet in M2 in having the same position in the sorted matrix M2. If two or more alphabets are same, then the program must consider them in the order of their occurrence. Finally, the program must print the modified matrix M1 as the output. Boundary Condition(s): 2 <= R, C <= 50 1 <= Matrix element value <= 1000 Input Format: The first line contains R and C separated by a space. The next R lines, each contains C integer values representing the integer matrix M1. The next R lines from the (R+2)th ...