NeetCode #204LC-1498MediumTwo Pointers
← Back to All Problems#204 · #1498 · Number of Subsequences That Satisfy the Given Sum Condition(满足条件的子序列数目)
📌 Problem Statement & Constraints
Given an array
nums and an integer target, count the number of non-empty subsequences whose minimum plus maximum is at most target. Return the count modulo 10^9 + 7. Constraints: 1 <= nums.length <= 10^5, 1 <= nums[i] <= 10^6, 1 <= target <= 10^6.🔒
Sign In to Unlock Full Solutions for All 973 Problems
Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!