Create A Word From The First Letters Of Multiple Words - Java Quiz Question


Create a word from the first letters of multiple words (2d char array). The words length might be different.

Input (2D Char array) Output (Char array)
{ { 'S', 'h', 'o', 'r', 't' }, {'M', 'e', 's', 's', 'a', 'g', 'e' }, {'S', 'e', 'r', 'v', 'i', 'c','e'} } {'S', 'M', 'S'}
{ {'N', 'o', 'r', 't', 'h'}, {'E', 'a', 's', 't'}, {'W', 'e', 's', 't'}, {'S', 'o', 'u', 't', 'h'} } {'N', 'E', 'W', 'S'}
{ { 'U', 'n', 'i', 't', 'e', 'd' }, { 'K', 'i', 'n', 'g', 'd','o','m' } } {'U', 'K'}



class CreateWordFromFirstLetters
{
    public static void main(String s[])
    {
        char multipleWords[][] ={
                            {
                                'M',
                                'a',
                                't',
                                'u',
                                'r',
                                'e'},
                        {
                                'E',
                                'f',
                                'f',
                                'e',
                                'c',
                                't',
                                'i',
                                'v',
                                'e'},
                        {
                                'R',
                                'o',
                                'b',
                                'u',
                                's',
                                't'},
                        {
                                'I',
                                'n',
                                't',
                                'e',
                                'l',
                    'l',
                                'i',
                                'g',
                                'e',
                                'n',
                                't'},
                        {
                                'T',
                                'r',
                                'a',
                                'i',
                                'n',
                                'i',
                                'n',
                                'g'}
                };
              
        char word[] = createWords(multipleWords);
        System.out.print("The word is " );
        for(char ch : word)
        System.out.print(ch + "");

    }


    public static char[] createWords(char[][] words)
    {
    }

}