Robinhood interview question

Array like question on karat