Publicis Sapient Interview Question

Coding test similar to robot return to origin