C#
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```\npublic class Solution {\n    private int MOD = 1000000007;\n\n    public int SumDistance(int[] nums, string s, int d)\n    {\n        for (int i = 0; i < nums.Length; i++)\n        {\n            if (s[i] == \'R\')\n                nums[i] += d;\n            else\n                nums[i] -= d;\n        }\n\n        long ans = 0;\n        long pref = 0;\n        Array.Sort(nums);\n        long n = s.Length - 1;\n\n        for (long i = 0; i < nums.Length; i++)\n        {\n            ans += i * (long)nums[(int)i] - pref;\n            ans %= MOD;\n            pref += nums[(int)i];\n        }\n\n        return (int)ans;\n    }\n}\n```
['C#']