C++ Solution ,if you're stuck with modulo😂😒
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    int sumDistance(vector<int>& nums, string s, int d) {\n        // modulo mc\n        vector<long long> v(nums.size(),0);\n        for(int i=0;i<nums.size();i++){\n            v[i] = nums[i];\n            if(s[i]==\'L\'){\n                v[i]-=d;\n            }\n            else v[i]+=d;\n        }\n        sort(v.begin(),v.end());\n        long long sum = 0, mod = 1e9 + 7, n = nums.size()-1;\n        for(int i=0;i<nums.size()-1;i++){\n            long long x = v[i+1]-v[i];\n            x = ((x%mod)*(n%mod))%mod;\n            x = (((i+1) % mod) * (x % mod)) % mod;\n            sum = ((sum%mod)+x)%mod;\n            n--;\n        }\n        int ans = sum;\n        return ans;\n        // 1 19 4 1\n        // 1 19 4 \n        // 1 19 \n        // 1 \n        // 19 4 1\n        // 19 4 \n        // 19\n        // 4 1\n        // 4\n        // 1\n    }\n};\n```
['Array', 'Brainteaser', 'Sorting', 'Prefix Sum', 'C++']