Hexaware Technologies interview question

Arrays swap question in the programing round