Python short DP
 Explanation:  \nI used recursive + dp to solve this problem. \nIf there is regulation by not using any library to generate Permutation Count, DP can come to he
<h4> Explanation: </h4>\nI used recursive + dp to solve this problem. \nIf there is regulation by not using any library to generate Permutation Count, DP can come to help to get the Permutation Count. Here is the code:\n\n\n```\nclass Solution:\n    def numOfWays(self, nums: List[int]) -> int:\n        dp = [[1 for r in range(len(nums)+1)] for l in range(len(nums)+1)]\n        \n        for i in range(1, len(nums)):\n            for j in range(1, len(nums)):\n                dp[i][j] = (dp[i][j-1] + dp[i-1][j])\n        \n        return (self.getNum(nums, dp) - 1)%(10**9+7)\n    \n    def getNum(self, nums, dp):\n        if len(nums) <= 2:\n            return 1\n        left, right = [num for num in nums if num < nums[0]], [num for num in nums if num > nums[0]]\n        return (self.getNum(left, dp)*dp[len(left)][len(right)]*self.getNum(right, dp))\n```
[]