Pergunta de entrevista da empresa Amazon

Not sure mostly like Armstrong number and some logic on matrix