University of California Counselors says that for repeated courses, CSU takes the highest grade, but UC takes the first C or higher grade.
So if you repeat a course where you first earned a B grade, it will still be a B grade when UC recalculates the GPA.