Solution - beats 100% runtime
Intuition\n- Follow the hints\n\n# Code\n\nclass Solution(object):\n    def sumDistance(self, nums, s, d):\n        """\n        :type nums: List[int]\n        
# Intuition\n- Follow the hints\n\n# Code\n```\nclass Solution(object):\n    def sumDistance(self, nums, s, d):\n        """\n        :type nums: List[int]\n        :type s: str\n        :type d: int\n        :rtype: int\n        """\n        \n\n        n = len(s)\n\n        new = [0] * n\n\n        for i in range(n):\n            if s[i] == \'L\':\n                new[i] = nums[i] - d\n            else:\n                new[i] = nums[i] + d\n\n        new.sort()\n\n        dis = 0\n        cur = 0\n\n        for i in range(n):\n            dis += i * new[i] - cur\n            cur += new[i]\n\n        return dis % (10**9+7)\n```
['Python']