onX interview question

Do this coding problem. Do you know how to do this coding problem?