Moveo Group interview question

online task to do machine loop