Surya Software Interview Question

They ask me to solve merge array intervals problem