Estimating the Charm Quark Diffusion Coefficient and thermalization time from D meson spectra at RHIC and LHC