# Questions tagged [k-sum]

Given a set of numbers, a target sum, and some k, the problem of finding a subset of size k that has the target sum

4 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
0answers
41 views

### Solution to 3Sum problem on Leetcode using HashTable

The problem of 3sum is described as: Given an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero....
1answer
36 views

### Printing all the combination of indexes for 2 sum exact outcome

Can somebody review the code and provide suggestions on where I can improve on the code like use of better data structure etc. Input: {1,7,2,8,3,6}, 9 Output: [0, 3] [1, 2] [4, 5] ...
0answers
49 views

### Closest 3Sum in Scala

This question is taken from Leet code. Given an array nums of n integers and an integer target, find three integers in nums such that the sum is closest to target. Return the sum of the three ...
0answers
76 views

### Check if list contains 3 elements with predefined sum

I have 2 solutions about puzzle I mentioned in title: solution 1( O(n^3) ): ...