Available question text
Count the number of non-empty subsequences whose minimum plus maximum is ≤ target (answer mod 1e9+7). With n up to 1e5, the usual efficient approach is to sort and use two pointers plus combinatorics (precomputed powers of two) to count valid subsets without enumerating them.
Related questions
Continue with questions that share topics or the same question type.
- Find Three Consecutive Integers That Sum to a Given Number
Coding
- Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum. Walk through Kadane's algorithm and explain the O(n) approach.
Coding
- Maximum Number That Sum of the Prices Is Less Than or Equal to K
Coding
- Number of Submatrices That Sum to Target
Coding
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
LinkedIn
Leetcode 1498. Number of Subsequences That Satisfy the Given Sum Condition
Reported Sep 7, 2026 · 1 source report
MID_LEVEL
Source snapshot: Nov 12, 2026
View source