Tech Mahindra interview question

Code for merging two arrays