Typescript clean solution
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```\nfunction maxNonDecreasingLength(nums1: number[], nums2: number[]): number {\n    let prev1 = 1\n    let prev2 = 1\n    let max = 1\n    for(let i = 1; i < nums1.length; i++){\n        // Compute num1\n        let use1 = nums1[i] >= nums1[i-1] ? prev1 + 1 : 1\n        let use2 = nums1[i] >= nums2[i-1] ? prev2 + 1 : 1\n        const curr1 = Math.max(use1, use2)\n\n        // Compute num2\n        use1 = nums2[i] >= nums1[i-1] ? prev1 + 1 : 1\n        use2 = nums2[i] >= nums2[i-1] ? prev2 + 1 : 1\n        const curr2 = Math.max(use1, use2)\n        prev1 = curr1\n        prev2 = curr2\n        max = Math.max(max, curr1, curr2)\n    }\n    return max\n};\n```
['TypeScript']