Brudite interview question

Simple array questions and logical reasoning trough coding