Leetcode 1498. Number of Subsequences That Satisfy the Given Sum Condition
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.
Asked at:
LinkedIn
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
Early September, 2026
Mid-level
Hello Interview Premium
Your account is free and you can post anonymously if you choose.