Python Two Pointer explanation O(1) Space O(n) Time 
IntuitionThe first observation to make is that the num arrays are strictly increasing. This means that we have no repeat integers and we can traverse using two
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->
The first observation to make is that the num arrays are strictly increasing. This means that we have no repeat integers and we can traverse using two pointers. 



# Approach
<!-- Describe your approach to solving the problem. -->


We are given two sorted lists and we want to find at what indices these lists have the same value. We make two pointers both pointing to the 0th index of the list. 

If at index1 of nums1 and index2 of nums2, the value aren't the same, increment the index of the smaller value. While doing this, keep track of a score for nums1 and nums2 array, accumulating the score if it's the smaller value.

 If the values at index1 of nums1 and index2 of nums2 are equal, then we need to determine what happens if the arrays jump paths. In order to determine the maximum path for nums1, we can greedily compare the scores of our paths up to index1 and index2. We can then set our scores for nums1 and nums2 to be equal to that maximum path, since it's always better to take that max path to reach a certain number. 

 Once we reach a point where index1 or index2 are outside the range of their respective array, compute the score for the array that still has nodes, then return the largest value modulo $1e^9+7$.


# Complexity
- Time complexity:
O(n)

- Space complexity:
O(1)

# Code
```python3 []
class Solution:
    def maxSum(self, nums1: List[int], nums2: List[int]) -> int:
        
        mod = int(1e9+7)

        score1 = 0
        score2= 0

        index1 = 0
        index2 = 0

        res = 0 

        while index1 < len(nums1) and index2 < len(nums2):
            if nums1[index1] < nums2[index2] :
                score1+=nums1[index1]
                index1+=1
            elif nums1[index1] > nums2[index2] : 
                score2+=nums2[index2]
                index2+=1
            else:
                
                score2 = max(score2+nums1[index1],score1+nums1[index1])
                score1 = score2
                index2+=1
                index1+=1
        
        while index1<len(nums1):
            score1+=nums1[index1]
            index1+=1
        while index2<len(nums2):
            score2+=nums2[index2]
            index2+=1
        res = max(score1, score2)
        return res % mod
                
                

```
['Python3']