President Trump says Russian President Vladimir Putin told him he would not have attacked Ukraine if Mr. Trump had been president in 2022.