Pergunta de entrevista da empresa WePay

2-d matrix question, string question and it was really tough to solve it in the given time.