Leetcode 0698. Partition to K Equal Sum Subsets

Posted on Tue 10 December 2024 in Leetcode • Tagged with subset-sum, backtracking

Question Link : https://leetcode.com/problems/partition-to-k-equal-sum-subsets/

Difficulty: Medium

Premium: False

Question

Given an integer array nums and an integer k, return true if it is possible to divide this array into k non-empty subsets whose sums are all equal.   Example 1:

Input: nums = [4,3,2,3,5,2 …


Continue reading

Leetcode 2389. Longest Subsequence With Limited Sum

Posted on Fri 22 November 2024 in Leetcode • Tagged with subset-sum, binary-search

Question Link : https://leetcode.com/problems/longest-subsequence-with-limited-sum/

Difficulty: Easy

Premium: False

Question

You are given an integer array nums of length n, and an integer array queries of length m. Return an array answer of length m where answer[i] is the maximum size of a subsequence that you can …


Continue reading