Robinhood interview question

spiral array