Implemented merge sorted arrays based on java solution that iterate from end index