Tesla interview question

Coding the memcpy function with overlap detection