Pergunta de entrevista da empresa Tata Consultancy Services

reverse array, change specific places in a string with an asterix