As noted by @ucbalumnus that the California UC’s and CSU’s will allow your Pre-calculus course to validate the failed Algebra2 course but unless you retake the exact same Algebra2 course, those F’s will be reported on the UC and CSU applications and will be used in the UC/CSU GPA calculation for admission if taken the summer after 9th through the summer prior to 12th.
Also note if not a CA resident, you need a minimum UC capped weighted GPA of 3.4 to be eligible to apply. CSU GPA for OOS applicants is lower at 3.0.
UC GPA calculator: GPA Calculator for the University of California – RogerHub