Yes, in this case... Why? Cause Britney was the one who helped it get to #1. S&M was slaying but I believe it was stuck at #2?? It was being cockblocked by E.T (Katy & Kanye). Once the remix was released was released,S&M got more attention in general, so people bought the one original version and the one with Britney.
But for other songs w/ collabs like Fancy, I wouldn't say Charli got a #1 just because Charli was already on the original track, whereas Britney was added on later and cause of the remix being added, Britney helped S&M go #1. Idk if yall see my point
