Pergunta de entrevista da empresa Wix

Create a function that gets a string and return the letter that is repeated the most, if there is more than one then return the last one. example: "test" = > t, "letter" => e