Schools that require/expect 3+ years of a foreign language want to see in-depth study on one topic. 2 years of A and 2 years of B does not equal 4 years of one of them.
For a school that requires 4 years, 3+1 may not meet the expectation. Even for those only recommending 4, it may fall short of other applicants.
For schools that require/recommend three, three plus one could be fine.
On the sciences, the recommendation is typically to be sure to cover the big three, then add AP courses to the extent possible. For an attractive application, I’d recommend fitting in Physics.