Robinhood Interview Question

Array like question on karat