Bolt interview question

Average array program. it was easy to solve.