MyTyles interview question

Javascript and React problem solving.