Jelena Ostapenko staged a remarkable comeback to beat Simona Halep in the French Open final, becoming the first player from Latvia to win a grand slam singles crown.