Dayyyyum how did they fit alll dat in O(1) BB ???? o.0
Intuition\nO(n) Time\nO(1) Space\n\n# Code\n\nclass Solution:\n    def maxNonDecreasingLength(self, nums1: List[int], nums2: List[int]) -> int:\n        n = len
# Intuition\nO(n) Time\nO(1) Space\n\n# Code\n```\nclass Solution:\n    def maxNonDecreasingLength(self, nums1: List[int], nums2: List[int]) -> int:\n        n = len(nums1)\n        opt1 = opt2 = res = 1\n\n        for i in range(1, n):\n            o1 = max(opt1+ 1 if nums1[i] >= nums1[i-1] else 1, opt2 + 1 if nums1[i]>= nums2[i-1] else 1)\n            o2 = max(opt2+ 1 if nums2[i] >= nums2[i-1] else 1, opt1 + 1 if nums2[i]>= nums1[i-1] else 1)\n            opt1, opt2 = o1, o2\n            res = max(res, opt1, opt2)\n        return res \n```
['Python3']