backtrack that takes the current bitmask, the number of pairs picked so far, and the memoization table as arguments.maxScore to 0.nums array that have not been picked yet (indicated by the bitmask).i * gcd(nums[x], nums[y]), where i is the number of pairs already picked plus 1.backtrack on the new state.maxScore with the maximum of itself and the sum of the current score and the recursive call result.maxScore in the memo table and return it.backtrack with an initial state of 0 (no elements picked) and 0 pairs picked.backtrack function as the maximum score.