C++ ignore collision
Observation\n- key point here is ignore collision and let all of them pass from each other \n\n# Complexity\n- Time complexity:O(NlogN)\n Add your time complexi
# Observation\n- key point here is ignore collision and let all of them pass from each other \n\n# Complexity\n- Time complexity:$$O(NlogN)$$\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:$$O(N)$$\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    int sumDistance(vector<int>& num, string s, int d) {\n        vector<long long> nums(num.size());\n        for(int i=0;i<nums.size();i++){\n            if(s[i]==\'R\'){\n                nums[i]=num[i]+d;\n            }\n            else{\n                nums[i]=num[i]-d;\n            }\n        }\n\n        sort(nums.begin(),nums.end());\n        int val=abs(nums[0]);\n         long mod=1e9+7;\n        for(int i=0;i<nums.size();i++){\n            nums[i]=((long long)(nums[i]+val))%mod;\n        }\n\n        long long ans=0;\n       \n        long long cnt=nums.size()-1;\n        for(int i=nums.size()-1;i>0;i--){\n            ans=((ans+(long long)(cnt*nums[i]))%mod)%mod;\n            cnt--;\n        }\n\n        cnt=1;\n        for(int i=nums.size()-2;i>=0;i--){\n            ans=(ans-nums[i]*cnt+mod)%mod;\n            cnt++;\n        }\n\n        return ans;\n    }\n};\n```
['C++']