Search⌘ K
AI Features

Solution: Get the Maximum Score

Solution: Get the Maximum Score lets you traverse either of two sorted arrays, switching at common values to maximize the sum of unique visited elements; return the result modulo a large prime.

Statement

You are given two sorted arrays of distinct integers, nums1 and nums2.

A valid path is constructed according to the following rules:

  • You start at the index 00 ...